Skip to content

Commit d00098b

Browse files
unamedkrclaude
andcommitted
pypi: fix cibuildwheel — drop macos-13, bundle quant.h before container build
Three failures from the first publish run: 1. macos-13 runner is no longer supported by GitHub Actions ("configuration 'macos-13-us-default' is not supported"). Drop it; ship arm64 wheels via macos-14 only. Intel macOS users can install from sdist (which still works on Intel via local compile). 2. Linux + Windows wheel builds failed in cibuildwheel's before-build: the python one-liner we used for header copy was awkward AND the more fundamental issue is that cibuildwheel mounts only package-dir into the manylinux container, so '../../quant.h' is unreachable from inside the build. Fix: stage quant.h into bindings/python/ quantcpp/_quant.h via a regular GitHub Actions step BEFORE invoking cibuildwheel. The before-build hook now just verifies the file is present (clear error if not). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent dd467f9 commit d00098b

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ jobs:
3131
arch: x86_64
3232
- os: ubuntu-latest
3333
arch: aarch64
34-
- os: macos-13 # Intel runner
35-
arch: x86_64
36-
- os: macos-14 # Apple Silicon runner
34+
- os: macos-14 # Apple Silicon (M-series). Intel macs deferred.
3735
arch: arm64
3836
- os: windows-latest
3937
arch: AMD64
@@ -50,6 +48,14 @@ jobs:
5048
with:
5149
platforms: arm64
5250

51+
# cibuildwheel mounts only the package-dir into Linux build containers,
52+
# so we must place quant.h INSIDE bindings/python/quantcpp/ before
53+
# invoking it. setup.py refreshes from ../../quant.h in dev tree, but
54+
# that path doesn't exist inside the manylinux container.
55+
- name: Bundle quant.h into package
56+
shell: bash
57+
run: cp quant.h bindings/python/quantcpp/_quant.h
58+
5359
- name: Build wheels
5460
uses: pypa/cibuildwheel@v2.21.3
5561
with:

bindings/python/pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ quantcpp = ["_quant.h", "*.so", "*.dylib", "*.dll"]
5656
build = "cp39-* cp310-* cp311-* cp312-* cp313-*"
5757
skip = "*-musllinux_i686 *-manylinux_i686 pp*"
5858

59-
# Verify the bundled header is in place before building
60-
before-build = "python -c \"import shutil, os; src='../../quant.h'; dst='quantcpp/_quant.h'; (os.path.exists(src) and shutil.copyfile(src, dst)) or (os.path.exists(dst) or (_ for _ in ()).throw(FileNotFoundError(dst)))\""
59+
# Verify the bundled header is present (CI step copies quant.h here before
60+
# this hook runs; setup.py also refreshes from ../../quant.h in dev tree).
61+
before-build = "python -c \"import os, sys; sys.exit(0 if os.path.exists('quantcpp/_quant.h') else (sys.stderr.write('quantcpp/_quant.h missing — bundle step did not run\\n') or 1))\""
6162

6263
# Smoke-test the built wheel before publishing
6364
test-command = "python -c \"import quantcpp; print('quantcpp', quantcpp.__version__)\""

0 commit comments

Comments
 (0)