Skip to content

Commit

Permalink
BLD/CI: support Python 3.13 (cp313/cp313t) in pyproject.toml and whee…
Browse files Browse the repository at this point in the history
…l 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
  • Loading branch information
rgommers committed Aug 12, 2024
1 parent a65ad65 commit 9d8e15a
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 183 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: actions/checkout@v4

- name: Build and test PyWavelets
uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2
uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
env:
CIBW_PLATFORM: pyodide
CIBW_TEST_REQUIRES: pytest matplotlib
Expand Down
171 changes: 0 additions & 171 deletions .github/workflows/freethreaded_wheels.yml

This file was deleted.

59 changes: 49 additions & 10 deletions .github/workflows/wheel_tests_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
cibw_python: ["cp310", "cp311", "cp312"]
cibw_python: ["cp310", "cp311", "cp312", "cp313", "cp313t"]
cibw_arch: ["x86_64"]
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
Expand All @@ -44,15 +44,29 @@ jobs:
name: Install Python
with:
python-version: "3.10"

- name: Install build deps; set CIBW environment variables
if: ${{ matrix.cibw_python }} == "cp313" || ${{ matrix.cibw_python }} == "cp313t"
run: |
PYPI_URL="https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"
CIBW_DEPS="pip install --upgrade pip build &&\
pip install --pre -i $PYPI_URL cython numpy scipy &&\
pip install pytest meson-python ninja"
NO_BUILD_ISOLATION="pip; args: --no-build-isolation"
echo "CIBW_BEFORE_BUILD=$CIBW_DEPS" >> "$GITHUB_ENV"
echo "CIBW_BEFORE_TEST=$CIBW_DEPS" >> "$GITHUB_ENV"
echo "CIBW_BUILD_FRONTEND=$NO_BUILD_ISOLATION" >> "$GITHUB_ENV"
- name: Build the wheel
uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2
uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
with:
output-dir: dist
env:
CIBW_BUILD: ${{ matrix.cibw_python }}-*
CIBW_ARCHS_LINUX: ${{ matrix.cibw_arch }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_1
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2
CIBW_FREE_THREADED_SUPPORT: True
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: wheels_linux_${{ matrix.cibw_arch }}_${{ matrix.cibw_python }}
Expand All @@ -66,7 +80,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
cibw_python: ["cp310", "cp311", "cp312"]
cibw_python: ["cp310", "cp311", "cp312", "cp313"]
cibw_arch: ["aarch64"]
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
Expand All @@ -80,8 +94,17 @@ jobs:
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- name: Install test dep; set CIBW environment variables
# Can be removed once numpy 2.1.0 is released
if: ${{ matrix.cibw_python }} == "cp313"
run: |
PYPI_URL="https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"
CIBW_DEPS="pip install --pre -i $PYPI_URL numpy"
echo "CIBW_BEFORE_TEST=$CIBW_DEPS" >> "$GITHUB_ENV"
- name: Build the wheel
uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2
uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
with:
output-dir: dist
env:
Expand All @@ -102,13 +125,16 @@ jobs:
matrix:
# macos-13 is the last runner that supports Intel (x86_64) architecture
os: [macos-13, macos-14]
cibw_python: ["cp310", "cp311", "cp312"]
cibw_python: ["cp310", "cp311", "cp312", "cp313", "cp313t"]
cibw_arch: ["x86_64", "arm64"]
exclude:
- os: macos-14
cibw_arch: "x86_64"
- os: macos-13
cibw_arch: "arm64"
- os: macos-13
cibw_arch: "x86_64"
cibw_python: "cp313t"
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
Expand All @@ -119,9 +145,21 @@ jobs:
with:
python-version: "3.12"

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

- name: Build wheels for CPython (macOS) (arm64)
if: matrix.cibw_arch == 'arm64'
uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2
uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
with:
output-dir: dist
env:
CIBW_BUILD: ${{ matrix.cibw_python }}-*
CIBW_ARCHS_MACOS: ${{ matrix.cibw_arch }}
CIBW_FREE_THREADED_SUPPORT: True

- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
Expand All @@ -151,7 +190,7 @@ jobs:
matrix:
os: [windows-latest]
cibw_arch: ["AMD64", "x86"]
cibw_python: ["cp310", "cp311", "cp312"]
cibw_python: ["cp310", "cp311", "cp312", "cp313"]
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
Expand All @@ -175,7 +214,7 @@ jobs:
architecture: x64

- name: Build Windows wheels for CPython
uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2
uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
with:
output-dir: dist
env:
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ requires = [
# Note that building against numpy 1.x works fine too - users and
# redistributors can do this by installing the numpy version they like and
# disabling build isolation.
"numpy>=2.0.0b1",
"numpy>=2.0.0; python_version<'3.13'",
"numpy>=2.1.0.rc1; python_version>='3.13'",
]

[project]
Expand Down

0 comments on commit 9d8e15a

Please sign in to comment.