Skip to content

Commit af5476f

Browse files
igerberclaude
andcommitted
Fix PyPI publish: upgrade PyO3 and limit Python versions
- Upgrade PyO3 from 0.20 to 0.22 (supports Python 3.13) - Upgrade numpy from 0.20 to 0.22 (compatible with PyO3 0.22) - Explicitly build for Python 3.9-3.13 only (skip 3.14 which is dev) - Use actions/setup-python on macOS/Windows to control Python version - Use -i flags for Linux manylinux builds Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1f80051 commit af5476f

2 files changed

Lines changed: 30 additions & 6 deletions

File tree

.github/workflows/publish.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
uses: PyO3/maturin-action@v1
2121
with:
2222
target: ${{ matrix.target }}
23-
args: --release --out dist
23+
args: --release --out dist -i python3.9 -i python3.10 -i python3.11 -i python3.12 -i python3.13
2424
manylinux: auto
2525
# Install OpenBLAS in manylinux container
2626
before-script-linux: |
@@ -36,9 +36,17 @@ jobs:
3636
build-macos-x86:
3737
name: Build macOS x86_64 wheels
3838
runs-on: macos-13 # x86_64 runner
39+
strategy:
40+
matrix:
41+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
3942
steps:
4043
- uses: actions/checkout@v4
4144

45+
- name: Set up Python ${{ matrix.python-version }}
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: ${{ matrix.python-version }}
49+
4250
- name: Install OpenBLAS
4351
run: brew install openblas
4452

@@ -56,16 +64,24 @@ jobs:
5664
- name: Upload wheels
5765
uses: actions/upload-artifact@v4
5866
with:
59-
name: wheels-macos-x86_64
67+
name: wheels-macos-x86_64-py${{ matrix.python-version }}
6068
path: dist/*.whl
6169

6270
# Build wheels on macOS (ARM64)
6371
build-macos-arm:
6472
name: Build macOS ARM64 wheels
6573
runs-on: macos-latest # ARM64 runner
74+
strategy:
75+
matrix:
76+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
6677
steps:
6778
- uses: actions/checkout@v4
6879

80+
- name: Set up Python ${{ matrix.python-version }}
81+
uses: actions/setup-python@v5
82+
with:
83+
python-version: ${{ matrix.python-version }}
84+
6985
- name: Install OpenBLAS
7086
run: brew install openblas
7187

@@ -83,16 +99,24 @@ jobs:
8399
- name: Upload wheels
84100
uses: actions/upload-artifact@v4
85101
with:
86-
name: wheels-macos-arm64
102+
name: wheels-macos-arm64-py${{ matrix.python-version }}
87103
path: dist/*.whl
88104

89105
# Build wheels on Windows
90106
build-windows:
91107
name: Build Windows wheels
92108
runs-on: windows-latest
109+
strategy:
110+
matrix:
111+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
93112
steps:
94113
- uses: actions/checkout@v4
95114

115+
- name: Set up Python ${{ matrix.python-version }}
116+
uses: actions/setup-python@v5
117+
with:
118+
python-version: ${{ matrix.python-version }}
119+
96120
# Windows uses Intel MKL which is more complex to set up
97121
# For now, skip Windows Rust backend - users get pure Python fallback
98122
- name: Build wheels
@@ -112,7 +136,7 @@ jobs:
112136
- name: Upload wheels
113137
uses: actions/upload-artifact@v4
114138
with:
115-
name: wheels-windows
139+
name: wheels-windows-py${{ matrix.python-version }}
116140
path: dist/*.whl
117141
if: always()
118142

rust/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ default = []
1616
extension-module = ["pyo3/extension-module"]
1717

1818
[dependencies]
19-
pyo3 = "0.20"
20-
numpy = "0.20"
19+
pyo3 = "0.22"
20+
numpy = "0.22"
2121
ndarray = { version = "0.15", features = ["rayon"] }
2222
rand = "0.8"
2323
rand_xoshiro = "0.6"

0 commit comments

Comments
 (0)