Skip to content

Commit d4ef812

Browse files
mikesshclaude
andcommitted
build: PyPI release as arda-mapper — publish.yml + testpypi.yml, bump 2.0.2
- distribution name -> arda-mapper (imports as `arda`); version 2.0.1 -> 2.0.2 - publish.yml: cibuildwheel (cp310-313, linux/macos/windows) + sdist, wheel smoke-import, OIDC trusted publishing (environment: pypi) on GitHub Release - testpypi.yml: same build, TestPyPI trusted publishing on workflow_dispatch / v* tags (dry-run) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 0b8cb4f commit d4ef812

3 files changed

Lines changed: 201 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Publish To PyPI
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build-sdist:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.12"
20+
- name: Install build tooling
21+
run: python -m pip install --upgrade pip build twine
22+
- name: Build source distribution
23+
run: python -m build --sdist
24+
- name: Check source distribution
25+
run: python -m twine check dist/*
26+
- name: Upload source distribution
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: python-sdist
30+
path: dist/
31+
32+
build-wheels:
33+
name: Build wheels on ${{ matrix.os }}
34+
runs-on: ${{ matrix.os }}
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
os: [ubuntu-latest, windows-latest, macos-latest] # macos-latest = Apple Silicon arm64
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Build wheels
42+
uses: pypa/cibuildwheel@v2.23.3
43+
env:
44+
# arda ships a pybind11/scikit-build-core C++ ext (src/_markup); scikit-build-core
45+
# pulls cmake + ninja into the build env automatically.
46+
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
47+
CIBW_SKIP: "*-musllinux_* *-manylinux_i686 *-win32"
48+
CIBW_TEST_SKIP: "*"
49+
- name: Upload wheel artifacts
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: python-wheels-${{ matrix.os }}
53+
path: wheelhouse/*.whl
54+
55+
test-wheels:
56+
name: Smoke-test wheel (${{ matrix.os }}, py${{ matrix.python-version }})
57+
needs: build-wheels
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
os: [ubuntu-latest, windows-latest, macos-latest]
62+
python-version: ["3.10", "3.11", "3.12", "3.13"]
63+
include:
64+
- os: ubuntu-latest
65+
artifact: python-wheels-ubuntu-latest
66+
- os: windows-latest
67+
artifact: python-wheels-windows-latest
68+
- os: macos-latest
69+
artifact: python-wheels-macos-latest
70+
runs-on: ${{ matrix.os }}
71+
steps:
72+
- uses: actions/setup-python@v5
73+
with:
74+
python-version: ${{ matrix.python-version }}
75+
- name: Download wheel artifacts
76+
uses: actions/download-artifact@v4
77+
with:
78+
name: ${{ matrix.artifact }}
79+
path: wheels/
80+
- name: Install wheel and import arda
81+
shell: bash
82+
run: |
83+
pip install --upgrade pip
84+
tag="cp${{ matrix.python-version }}"; tag="${tag/./}"
85+
python - "$tag" <<'PY'
86+
import sys, glob, subprocess
87+
tag = sys.argv[1]
88+
matches = sorted(glob.glob(f"wheels/arda_mapper-*-{tag}-*.whl"))
89+
if len(matches) != 1:
90+
raise SystemExit(f"expected 1 wheel for {tag}, found {len(matches)}: {matches}")
91+
subprocess.check_call([sys.executable, "-m", "pip", "install", matches[0]])
92+
PY
93+
python -c "import arda; print('[OK] arda', arda.__version__)"
94+
95+
publish:
96+
name: Publish To PyPI
97+
needs: [build-sdist, build-wheels, test-wheels]
98+
runs-on: ubuntu-latest
99+
environment: pypi
100+
permissions:
101+
contents: read
102+
id-token: write # required for OIDC trusted publishing
103+
steps:
104+
- uses: actions/checkout@v4
105+
- name: Download distributions
106+
uses: actions/download-artifact@v4
107+
with:
108+
pattern: python-*
109+
merge-multiple: true
110+
path: dist/
111+
- name: Validate package version matches release tag
112+
if: github.event_name == 'release'
113+
run: |
114+
python - <<'PY'
115+
from pathlib import Path
116+
import tomllib
117+
version = tomllib.loads(Path("pyproject.toml").read_text())["project"]["version"]
118+
tag = "${{ github.event.release.tag_name }}"
119+
norm = tag[1:] if tag.startswith("v") else tag
120+
if version != norm:
121+
raise SystemExit(f"Version mismatch: pyproject.toml={version}, tag={tag}")
122+
print(f"Version check passed: {version} == {tag}")
123+
PY
124+
- name: List distributions
125+
run: ls -R dist/
126+
- name: Publish distributions to PyPI
127+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/testpypi.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Publish To TestPyPI
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v*"
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build-sdist:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.12"
20+
- name: Install build tooling
21+
run: python -m pip install --upgrade pip build twine
22+
- name: Build source distribution
23+
run: python -m build --sdist
24+
- name: Check source distribution
25+
run: python -m twine check dist/*
26+
- name: Upload source distribution
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: python-sdist
30+
path: dist/
31+
32+
build-wheels:
33+
name: Build wheels on ${{ matrix.os }}
34+
runs-on: ${{ matrix.os }}
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
os: [ubuntu-latest, windows-latest, macos-latest]
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Build wheels
42+
uses: pypa/cibuildwheel@v2.23.3
43+
env:
44+
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
45+
CIBW_SKIP: "*-musllinux_* *-manylinux_i686 *-win32"
46+
CIBW_TEST_COMMAND: 'python -c "import arda; print(''arda OK'')"'
47+
- name: Upload wheel artifacts
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: python-wheels-${{ matrix.os }}
51+
path: wheelhouse/*.whl
52+
53+
publish-testpypi:
54+
name: Publish To TestPyPI
55+
needs: [build-sdist, build-wheels]
56+
runs-on: ubuntu-latest
57+
permissions:
58+
contents: read
59+
id-token: write
60+
steps:
61+
- name: Download distributions
62+
uses: actions/download-artifact@v4
63+
with:
64+
pattern: python-*
65+
merge-multiple: true
66+
path: dist/
67+
- name: List distributions
68+
run: ls -R dist/
69+
- name: Publish distributions to TestPyPI
70+
uses: pypa/gh-action-pypi-publish@release/v1
71+
with:
72+
repository-url: https://test.pypi.org/legacy/

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ requires = ["scikit-build-core>=0.10", "pybind11>=2.12"]
33
build-backend = "scikit_build_core.build"
44

55
[project]
6-
name = "arda"
7-
version = "2.0.1"
6+
name = "arda-mapper" # PyPI distribution name (`arda` is taken); imports as `arda`
7+
version = "2.0.2"
88
description = "Antigen Receptor Domain Annotation — fast TCR/BCR FR/CDR region annotation"
99
readme = "README.md"
1010
requires-python = ">=3.10"

0 commit comments

Comments
 (0)