@@ -64,14 +64,24 @@ jobs:
6464 matrix :
6565 python-version : ["3.8", "3.9", "3.10", "3.11", "3.12", pypy-3.8, pypy-3.9, pypy-3.10]
6666 platform : [
67- { os: "macos-latest", python-architecture: "x64 ", rust-target: "x86_64 -apple-darwin" },
67+ { os: "macos-latest", python-architecture: "arm64 ", rust-target: "aarch64 -apple-darwin" },
6868 { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
6969 { os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
7070 ]
7171 include :
7272 # Just test one x86 Windows Python for simplicity
7373 - python-version : 3.12
7474 platform : { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" }
75+ # Just test one x64 macOS Python for simplicity
76+ - python-version : 3.12
77+ platform : { os: "macos-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin" }
78+ # Just test one x64 macOS Python for simplicity
79+ exclude :
80+ # macOS arm doesn't have Python builds before 3.10
81+ - python-version : 3.9
82+ platform : { os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }
83+ - python-version : 3.8
84+ platform : { os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }
7585
7686 steps :
7787 - uses : actions/checkout@v4
8797 with :
8898 targets : ${{ matrix.platform.rust-target }}
8999
90- - name : Install Rust aarch64-apple-darwin target
91- if : matrix.platform.os == 'macos-latest'
92- run : rustup target add aarch64-apple-darwin
93-
94100 - name : Install test dependencies
95101 run : pip install --upgrade nox
96102
@@ -104,14 +110,14 @@ jobs:
104110 run : nox -s test-examples
105111
106112 - name : Test macOS universal2
107- if : matrix.platform.os == 'macos-latest' && !startsWith(matrix.python-version, 'pypy')
113+ if : ${{ startsWith( matrix.platform.os, 'macos') && !startsWith(matrix.python-version, 'pypy') }}
108114 shell : bash
109115 env :
110- DEVELOPER_DIR : /Applications/Xcode.app/Contents/Developer
111116 MACOSX_DEPLOYMENT_TARGET : ' 10.9'
112117 ARCHFLAGS : -arch x86_64 -arch arm64
113- PYO3_CROSS_LIB_DIR : /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib
114118 run : |
119+ rustup target add aarch64-apple-darwin
120+ rustup target add x86_64-apple-darwin
115121 cd examples/namespace_package
116122 pip install build wheel
117123 python -m build --no-isolation
@@ -143,10 +149,6 @@ jobs:
143149
144150 - uses : dtolnay/rust-toolchain@stable
145151
146- - name : Install Rust aarch64-apple-darwin target
147- if : matrix.os == 'macos-latest'
148- run : rustup target add aarch64-apple-darwin
149-
150152 - name : Build package
151153 run : pip install -e .
152154
@@ -307,7 +309,7 @@ jobs:
307309 - uses : actions/checkout@v4
308310 - uses : dtolnay/rust-toolchain@stable
309311 with :
310- targets : aarch64-apple-darwin
312+ targets : aarch64-apple-darwin,x86_64-apple-darwin
311313312314 env :
313315 CIBW_BUILD : cp39-*
0 commit comments