Repository navigation
ci: macOS (universal2) wheels + release path hardening; v3.1.0 - #626
Merged
Merged
Conversation
Add a build-macos job to release.yml: macos-15 (arm64), CPython 3.10-3.14, MACOSX_DEPLOYMENT_TARGET=11.0, with two gates before the artifact is kept -- an assertion that the wheel's platform tag is macosx_*_arm64 or macosx_*_universal2, and `delocate-wheel --require-archs arm64` on the binaries. ARCHFLAGS is deliberately left unset: forcing `-arch arm64` under a universal2 interpreter would emit arm64-only binaries still tagged `universal2`, i.e. a wheel claiming Intel support it does not have. Fix the publish step, which would have dropped the new wheels silently. It uploaded a hand-maintained list of per-platform globs (`dist/*-manylinux*.whl dist/*-win_amd64.whl dist/*.tar.gz`); a `macosx_11_0_arm64` wheel matches none of them, so it would have been downloaded, moved into dist/, listed -- and never uploaded, with a green build. Upload `dist/*` instead, behind the completeness gate that now also requires macOS wheels. This makes the per-job artifact paths load-bearing: the manylinux job must upload `dist/*-manylinux*.whl` rather than `dist/*.whl`, because the manylinux action leaves both the raw `linux_x86_64` wheels and the audited ones in dist/, and PyPI rejects a bare `linux_x86_64` tag. Split deploy into validate-dist and publish so the aggregation and gating logic -- where that silent failure lived -- can be exercised without credentials. validate-dist holds no secrets and no environment; publish is the only job gated on `github.event_name == 'release'`. With workflow_dispatch and a `ci/release-dryrun-**` push trigger, the entire release path is now a dry run away. Add build.yml: compile the extensions and run the suite on Linux, Windows and macOS for every push and pull request. Previously the first macOS or Windows compile of a change happened inside release.yml, after the GitHub release had already been created, when the only remedy is yanking a version. Drop CYTHON_COMPILING_IN_PYPY=1 from the navconfig.exceptions extension: the macro told Cython-generated C it was running under PyPy and enabled PyPy-only code paths on CPython. Select /O2 or -O2 from the detected compiler instead of relying on MSVC accepting the GCC spelling. Verified: 7/7 extensions rebuild clean without the macro, `twine check` passes on the resulting wheel, ruff is clean on setup.py, every bash block in both workflows parses, and the suite is unchanged at 128 passed. Native macOS/Windows compilation can only be verified on GitHub Actions. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The dry run (run 42087120664) showed actions/setup-python hands macos-15 a universal2 interpreter: the wheels come out tagged `macosx_11_0_universal2`, and inspecting the Mach-O headers confirms all seven extension modules are fat binaries with real x86_64 and arm64 slices. So Intel Macs are covered by the same wheel and no macos-15-intel job is needed -- the comment and CHANGELOG entry claiming Intel falls back to the sdist were wrong. This also vindicates leaving ARCHFLAGS unset: with `-arch arm64` forced, that universal2 interpreter would have produced arm64-only binaries that sysconfig still tags universal2, i.e. a wheel promising Intel support it does not have. Derive --require-archs from the tag instead of hardcoding arm64, so that exact mislabelling cannot pass the gate: universal2 now requires both slices, a thin arm64 tag requires arm64, and any other macosx tag is an error. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Minor bump, equivalent to `make bump-minor`, plus `.bumpversion.cfg`'s current_version, which that Makefile target leaves behind. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Also drop `[bumpversion:file:pyproject.toml]`. pyproject.toml carries no version field -- it declares `dynamic = ["version"]` and reads `navconfig.version.__version__` -- so the only version-shaped strings in it are dependency pins (`python-logstash-async>=2.7.2,<=3.0.0`, `pre-commit>=3.0.0`). bumpversion substitutes with str.replace, i.e. every occurrence, so a real `bumpversion` run would have silently rewritten those pins. navconfig/version.py is now the single declared target, which is also the only file `make bump-minor` touches. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
release.ymlcould not build or distribute macOS wheels. It now does, and therelease path it publishes through is verifiable without touching PyPI.
The bug this started from
The publish step uploaded a hand-maintained list of per-platform globs:
A
navconfig-3.1.0-cp312-cp312-macosx_11_0_universal2.whlmatches none ofthem. Adding a macOS build job alone would have produced wheels that were
built, uploaded as artifacts, moved into
dist/, printed in the filelisting — and never published, on a green build.
It now uploads
dist/*behind the completeness gate, which is what that gateis for. Consequence: the per-job artifact paths became load-bearing. The
manylinux job must upload
dist/*-manylinux*.whl, notdist/*.whl, becausethe manylinux action leaves both the raw
linux_x86_64wheels and theaudited ones in
dist/, and PyPI rejects a barelinux_x86_64tag.macOS wheels are universal2, not arm64
actions/setup-pythonhandsmacos-15a universal2 interpreter, so thewheels come out tagged
macosx_11_0_universal2. Inspecting the Mach-O headersof the published artifact confirms all seven extension modules are fat
binaries with real
x86_64andarm64slices:So one wheel per interpreter serves Apple Silicon and Intel Macs, and no
macos-15-inteljob is needed.This is also why
ARCHFLAGSis deliberately left unset: forcing-arch arm64under that universal2 interpreter would emit arm64-onlybinaries that
sysconfigstill tagsuniversal2— a wheel promising Intelsupport it does not have. The arch gate derives
delocate-wheel --require-archsfrom the tag (universal2→x86_64,arm64,*arm64→arm64, anything else → error) precisely to catch that.Dry-runnable release path
deploywas split so everything checkable without credentials runs on anyevent:
build(manylinux),build-windows×5,build-macos×5,build-sourcevalidate-dist— artifact aggregation, completeness gate,twine checkpublishenvironment: pypi,id-tokenif: github.event_name == 'release'test-installneeds: publish)secrets.andid-tokenappear inpublishonly, verified by script. Withworkflow_dispatchplus apush: ci/release-dryrun-**trigger, the wholepath is a dry run away. Note
workflow_dispatchonly becomes usable once thisfile is on the default branch, which is why the branch-prefix trigger exists.
Also here
build.yml(new). Compiles the extensions and runs the suite on Linux,Windows and macOS for every push and PR. Previously the first macOS or
Windows compile of a change happened inside
release.yml— after the GitHubrelease had already been created, when the only remedy is yanking a version.
setup.py: droppedCYTHON_COMPILING_IN_PYPY=1from thenavconfig.exceptionsextension. The macro told Cython-generated C it wasrunning under PyPy and enabled PyPy-only code paths on CPython.
/O2vs-O2is now selected from the detected compiler instead of relying on MSVCaccepting the GCC spelling.
pyproject.toml: real OS classifiers;OS Independentwas never trueof binary wheels.
.bumpversion.cfg: dropped[bumpversion:file:pyproject.toml]. Thatfile declares
dynamic = ["version"], so its only version-shaped stringsare dependency pins (
python-logstash-async>=2.7.2,<=3.0.0,pre-commit>=3.0.0) — and bumpversion substitutes withstr.replace, i.e.every occurrence.
Verification
Dry run 42090622381 — green, 13 jobs,
publishandtest-installskipped. 16 artifacts, all3.1.0,twine checkPASSED on every one, no rawlinux_x86_64wheels:manylinux2014_x86_64.manylinux_2_17_x86_64win_amd64macosx_11_0_universal2Locally: 7/7 extensions rebuild clean without the PyPy macro,
ruffclean onsetup.py, every bash block in both workflows parses, suite unchanged at128 passed.
Open points for the reviewer
[3.1.0]carries "VaultReader.set/deletenow split nestedkeys on the last
/— behavior change for keys likea/b/KEY". That isarguably breaking and would point at 4.0.0. Left at 3.1.0 as decided.
test-installno longer hascontinue-on-error, so a PyPI propagationdelay can turn a run red after a correct publish. Informative, not
destructive — one line to revert if unwanted.
test-installonly runs on arm64 macOS runners, so the x86_64 slice isnever exercised at install time. A
macos-15-intelentry on that job alonewould cover it.
push: ci/release-dryrun-**trigger? It is inert unless someonenames a branch with that prefix on purpose.
checkout@v4,setup-python@v5,upload-artifact@v4and
setup-uv@v4target Node 20 and are being forced onto Node 24.Separate cleanup.
The only thing a dry run cannot cover is, by definition, the
twine uploaditself.
🤖 Generated with Claude Code