Skip to content

Commit 9d8e15a

Browse files
committed
BLD/CI: support Python 3.13 (cp313/cp313t) in pyproject.toml and wheel builds
This is a single large update that does the following: - Depend on numpy>=2.1.0rc1 for Python 3.13 - Update to `cibuildwheel` 2.20.0 (for Python 3.13.0rc1) - Update `musllinux_2014` from `1_1` to `1_2` (`1_1 is almost EOL, and little-used) - Merge the free-threaded and regular wheel build jobs - Drop `PYTHON_GIL=0` from testing, because we don't need it anymore (all extension modules in PyWavelets and NumPy are marked as compatible) - Build cp313 and cp313t wheels in release jobs - Add macOS arm64 free-threaded wheels
1 parent a65ad65 commit 9d8e15a

4 files changed

Lines changed: 52 additions & 183 deletions

File tree

.github/workflows/emscripten.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
uses: actions/checkout@v4
3838

3939
- name: Build and test PyWavelets
40-
uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2
40+
uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
4141
env:
4242
CIBW_PLATFORM: pyodide
4343
CIBW_TEST_REQUIRES: pytest matplotlib

.github/workflows/freethreaded_wheels.yml

Lines changed: 0 additions & 171 deletions
This file was deleted.

.github/workflows/wheel_tests_and_release.yml

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
fail-fast: false
3535
matrix:
3636
os: [ubuntu-latest]
37-
cibw_python: ["cp310", "cp311", "cp312"]
37+
cibw_python: ["cp310", "cp311", "cp312", "cp313", "cp313t"]
3838
cibw_arch: ["x86_64"]
3939
steps:
4040
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
@@ -44,15 +44,29 @@ jobs:
4444
name: Install Python
4545
with:
4646
python-version: "3.10"
47+
48+
- name: Install build deps; set CIBW environment variables
49+
if: ${{ matrix.cibw_python }} == "cp313" || ${{ matrix.cibw_python }} == "cp313t"
50+
run: |
51+
PYPI_URL="https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"
52+
CIBW_DEPS="pip install --upgrade pip build &&\
53+
pip install --pre -i $PYPI_URL cython numpy scipy &&\
54+
pip install pytest meson-python ninja"
55+
NO_BUILD_ISOLATION="pip; args: --no-build-isolation"
56+
echo "CIBW_BEFORE_BUILD=$CIBW_DEPS" >> "$GITHUB_ENV"
57+
echo "CIBW_BEFORE_TEST=$CIBW_DEPS" >> "$GITHUB_ENV"
58+
echo "CIBW_BUILD_FRONTEND=$NO_BUILD_ISOLATION" >> "$GITHUB_ENV"
59+
4760
- name: Build the wheel
48-
uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2
61+
uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
4962
with:
5063
output-dir: dist
5164
env:
5265
CIBW_BUILD: ${{ matrix.cibw_python }}-*
5366
CIBW_ARCHS_LINUX: ${{ matrix.cibw_arch }}
5467
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
55-
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_1
68+
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2
69+
CIBW_FREE_THREADED_SUPPORT: True
5670
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
5771
with:
5872
name: wheels_linux_${{ matrix.cibw_arch }}_${{ matrix.cibw_python }}
@@ -66,7 +80,7 @@ jobs:
6680
fail-fast: false
6781
matrix:
6882
os: [ubuntu-latest]
69-
cibw_python: ["cp310", "cp311", "cp312"]
83+
cibw_python: ["cp310", "cp311", "cp312", "cp313"]
7084
cibw_arch: ["aarch64"]
7185
steps:
7286
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
@@ -80,8 +94,17 @@ jobs:
8094
uses: docker/setup-qemu-action@v3
8195
with:
8296
platforms: arm64
97+
98+
- name: Install test dep; set CIBW environment variables
99+
# Can be removed once numpy 2.1.0 is released
100+
if: ${{ matrix.cibw_python }} == "cp313"
101+
run: |
102+
PYPI_URL="https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"
103+
CIBW_DEPS="pip install --pre -i $PYPI_URL numpy"
104+
echo "CIBW_BEFORE_TEST=$CIBW_DEPS" >> "$GITHUB_ENV"
105+
83106
- name: Build the wheel
84-
uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2
107+
uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
85108
with:
86109
output-dir: dist
87110
env:
@@ -102,13 +125,16 @@ jobs:
102125
matrix:
103126
# macos-13 is the last runner that supports Intel (x86_64) architecture
104127
os: [macos-13, macos-14]
105-
cibw_python: ["cp310", "cp311", "cp312"]
128+
cibw_python: ["cp310", "cp311", "cp312", "cp313", "cp313t"]
106129
cibw_arch: ["x86_64", "arm64"]
107130
exclude:
108131
- os: macos-14
109132
cibw_arch: "x86_64"
110133
- os: macos-13
111134
cibw_arch: "arm64"
135+
- os: macos-13
136+
cibw_arch: "x86_64"
137+
cibw_python: "cp313t"
112138
steps:
113139
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
114140
with:
@@ -119,9 +145,21 @@ jobs:
119145
with:
120146
python-version: "3.12"
121147

148+
- name: Install build deps; set CIBW environment variables
149+
if: ${{ matrix.cibw_python }} == "cp313" || ${{ matrix.cibw_python }} == "cp313t"
150+
run: |
151+
PYPI_URL="https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"
152+
CIBW_DEPS="pip install --upgrade pip build &&\
153+
pip install --pre -i $PYPI_URL cython numpy scipy &&\
154+
pip install pytest meson-python ninja"
155+
NO_BUILD_ISOLATION="pip; args: --no-build-isolation"
156+
echo "CIBW_BEFORE_BUILD=$CIBW_DEPS" >> "$GITHUB_ENV"
157+
echo "CIBW_BEFORE_TEST=$CIBW_DEPS" >> "$GITHUB_ENV"
158+
echo "CIBW_BUILD_FRONTEND=$NO_BUILD_ISOLATION" >> "$GITHUB_ENV"
159+
122160
- name: Build wheels for CPython (macOS) (x86_64)
123161
if: matrix.cibw_arch == 'x86_64'
124-
uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2
162+
uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
125163
with:
126164
output-dir: dist
127165
env:
@@ -130,12 +168,13 @@ jobs:
130168

131169
- name: Build wheels for CPython (macOS) (arm64)
132170
if: matrix.cibw_arch == 'arm64'
133-
uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2
171+
uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
134172
with:
135173
output-dir: dist
136174
env:
137175
CIBW_BUILD: ${{ matrix.cibw_python }}-*
138176
CIBW_ARCHS_MACOS: ${{ matrix.cibw_arch }}
177+
CIBW_FREE_THREADED_SUPPORT: True
139178

140179
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
141180
with:
@@ -151,7 +190,7 @@ jobs:
151190
matrix:
152191
os: [windows-latest]
153192
cibw_arch: ["AMD64", "x86"]
154-
cibw_python: ["cp310", "cp311", "cp312"]
193+
cibw_python: ["cp310", "cp311", "cp312", "cp313"]
155194
steps:
156195
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
157196
with:
@@ -175,7 +214,7 @@ jobs:
175214
architecture: x64
176215

177216
- name: Build Windows wheels for CPython
178-
uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2
217+
uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
179218
with:
180219
output-dir: dist
181220
env:

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ requires = [
1616
# Note that building against numpy 1.x works fine too - users and
1717
# redistributors can do this by installing the numpy version they like and
1818
# disabling build isolation.
19-
"numpy>=2.0.0b1",
19+
"numpy>=2.0.0; python_version<'3.13'",
20+
"numpy>=2.1.0.rc1; python_version>='3.13'",
2021
]
2122

2223
[project]

0 commit comments

Comments
 (0)