Skip to content

Commit

Permalink
Merge pull request #119 from ecmwf/feature/add-python-3.13
Browse files Browse the repository at this point in the history
Add Python 3.13 binary wheels
  • Loading branch information
iainrussell authored Jan 16, 2025
2 parents 1bfc732 + 1ef0dff commit 062d63f
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 11 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/build-wheel-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ jobs:
# if: false # for temporarily disabling for debugging

runs-on: [self-hosted, Linux, platform-builder-Rocky-8.6]
container: dockcross/manylinux_2_28-x64:latest
container:
image: dockcross/manylinux_2_28-x64:latest
#options: --pull always

name: Build manylinux_2_28-x64

Expand Down Expand Up @@ -91,14 +93,22 @@ jobs:
name: wheel-manylinux2014-3.12
path: wheelhouse/*.whl

# ################################################################
- run: ./scripts/wheel-linux.sh 3.13
- uses: actions/upload-artifact@v4
name: Upload wheel 3.13
with:
name: wheel-manylinux2014-3.13
path: wheelhouse/*.whl

test:

needs: build

strategy:
fail-fast: false
matrix: # We don't test 3.6, as it is not supported anymore by github actions
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

runs-on: [self-hosted, Linux, platform-builder-Rocky-8.6]

Expand All @@ -122,7 +132,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

needs: [test, build]

Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/build-wheel-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ jobs:
path: wheelhouse/*.whl
- run: rm -fr wheelhouse

- run: ./scripts/wheel-macos.sh "3.13"
- run: ls -l wheelhouse
- uses: actions/upload-artifact@v4
name: Upload wheel 3.13 ${{ matrix.arch_type }}
with:
name: wheel-macos-${{ matrix.arch_type }}-3.13
path: wheelhouse/*.whl
- run: rm -fr wheelhouse

test:
needs: build

Expand All @@ -100,7 +109,7 @@ jobs:
max-parallel: 1
matrix:
arch_type: [ARM64, X64]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

runs-on: [self-hosted, macOS, "${{ matrix.arch_type }}"]

Expand Down Expand Up @@ -130,14 +139,16 @@ jobs:
max-parallel: 1
matrix:
arch_type: [ARM64, X64]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

runs-on: [self-hosted, macOS, "${{ matrix.arch_type }}"]

steps:

- run: mkdir artifact-${{ matrix.arch_type }}-${{ matrix.python-version }}

- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: wheel-macos-${{ matrix.arch_type }}-${{ matrix.python-version }}
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/build-wheel-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,29 @@ jobs:

################################################################

- name: Set up Python 3.13
uses: actions/setup-python@v4
with:
python-version: "3.13"
architecture: ${{ matrix.architecture }}

- run: ./scripts/wheel-windows.sh "3.13"
- uses: actions/upload-artifact@v4
name: Upload wheel 3.13
with:
name: wheel-windows-3.13-${{ matrix.architecture }}
path: wheelhouse/*.whl

################################################################


test:
needs: build
runs-on: windows-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
architecture: ["x64"]

defaults:
Expand Down Expand Up @@ -195,7 +210,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
architecture: ["x64"]

steps:
Expand Down
8 changes: 4 additions & 4 deletions scripts/wheel-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ TOPDIR=$(/bin/pwd)

LD_LIBRARY_PATH=$TOPDIR/install/lib:$TOPDIR/install/lib64:$LD_LIBRARY_PATH

sudo /opt/python/cp${version}-cp${version}*/bin/pip3 install 'setuptools>=72.1.0'
/opt/python/cp${version}-cp${version}*/bin/pip3 list
sudo /opt/python/cp${version}-cp${version}/bin/pip3 install 'setuptools>=72.1.0'
/opt/python/cp${version}-cp${version}/bin/pip3 list

rm -fr dist wheelhouse
/opt/python/cp${version}-cp${version}*/bin/python3 setup.py --binary-wheel bdist_wheel
/opt/python/cp${version}-cp${version}/bin/python3 setup.py --binary-wheel bdist_wheel

# Do it twice to get the list of libraries

Expand All @@ -35,6 +35,6 @@ pip3 install -r scripts/requirements.txt
python3 ./scripts/copy-licences.py libs

rm -fr dist wheelhouse
/opt/python/cp${version}-cp${version}*/bin/python3 setup.py --binary-wheel bdist_wheel
/opt/python/cp${version}-cp${version}/bin/python3 setup.py --binary-wheel bdist_wheel
auditwheel repair dist/*.whl
rm -fr dist
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def shared(directory):
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Operating System :: OS Independent",
Expand Down

0 comments on commit 062d63f

Please sign in to comment.