Skip to content

Commit 3aba710

Browse files
authored
Move CIBW_* environment variables to pyproject.toml (#24)
1 parent a4557b9 commit 3aba710

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

.github/workflows/wheels.yml

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,6 @@ on:
1010
types:
1111
- published
1212

13-
env:
14-
# Python 3.12+ is handled using the stable ABI, no need to build later versions
15-
# Only build for PyPy 3.9
16-
CIBW_SKIP: "pp37* pp38*"
17-
# Target 64 bit architectures (x86_64, and arm64 on macOS)
18-
CIBW_ARCHS_WINDOWS: auto64
19-
CIBW_ARCHS_LINUX: auto64
20-
CIBW_ARCHS_MACOS: x86_64 arm64
21-
# Target older versions of macOS and Linux for good compatibility
22-
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.14
23-
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
24-
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
25-
# Necessary to see build output from the actual compilation
26-
CIBW_BUILD_VERBOSITY: 1
27-
# Temporary: use pre-release Python 3.12 for stable API builds
28-
CIBW_PRERELEASE_PYTHONS: True
29-
# GitHub Actions doesn't have macOS/arm64 runners, skip test on this platform
30-
CIBW_TEST_SKIP: "*-macosx_arm64"
31-
# Run pytest to ensure that the package was correctly built
32-
CIBW_TEST_COMMAND: pytest {project}/tests
33-
CIBW_TEST_REQUIRES: pytest
34-
3513
jobs:
3614
build_sdist:
3715
name: Build SDist
@@ -66,6 +44,12 @@ jobs:
6644
submodules: true
6745

6846
- uses: pypa/[email protected]
47+
env:
48+
# Cross-compile on macOS
49+
CIBW_ARCHS_MACOS: x86_64 arm64
50+
51+
# Temporary: use pre-release Python 3.12 for stable API builds
52+
CIBW_PRERELEASE_PYTHONS: True
6953

7054
- name: Verify clean directory
7155
run: git diff --exit-code

pyproject.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,23 @@ Homepage = "https://github.com/wjakob/nanobind_example"
2222
[tool.scikit-build]
2323
# Build stable ABI wheels for CPython 3.12+
2424
wheel.py-api = "cp312"
25+
26+
27+
[tool.cibuildwheel]
28+
# PyPy38 is not supported by nanobind
29+
skip = ["pp38*"]
30+
31+
# 32-bit builds are not supported by nanobind
32+
archs = ["auto64"]
33+
34+
# Necessary to see build output from the actual compilation
35+
build-verbosity = 1
36+
37+
# Run pytest to ensure that the package was correctly built
38+
test-command = "pytest {project}/tests"
39+
test-requires = "pytest"
40+
41+
# Needed for full C++17 support
42+
[tool.cibuildwheel.macos.environment]
43+
MACOSX_DEPLOYMENT_TARGET = "10.14"
44+

0 commit comments

Comments
 (0)