1- # This file is autogenerated by maturin v1.7.0
2- # To update, run
3- #
4- # maturin generate-ci github
1+ # This file was originally generated by maturin v1.7.0 (`maturin generate-ci github`).
2+ # It has been customized for free-threaded wheels and resilience when setup-python /
3+ # actions/python-versions temporarily lacks builds for a given OS/arch/version.
54#
65name : CI
76
@@ -40,13 +39,29 @@ jobs:
4039 - uses : actions/checkout@v4
4140 - uses : actions/setup-python@v5
4241 with :
43- python-version : 3.x
44- check-latest : true
42+ python-version : ' 3.x'
43+ - uses : actions/setup-python@v5
44+ id : setup_freethreaded
45+ continue-on-error : true
46+ with :
47+ python-version : |
48+ 3.13t
49+ 3.14t
50+ - name : Configure maturin interpreters
51+ shell : bash
52+ run : |
53+ INTERP='3.8 3.9 3.10 3.11 3.12 3.13 3.14'
54+ if [[ '${{ steps.setup_freethreaded.outcome }}' == 'success' ]]; then
55+ INTERP="$INTERP 3.13t 3.14t"
56+ else
57+ echo '::warning::Free-threaded Python (3.13t/3.14t) unavailable from setup-python; skipping cp313t/cp314t wheels this run.'
58+ fi
59+ echo "MATURIN_INTERPRETERS=$INTERP pypy3.11" >> "$GITHUB_ENV"
4560 - name : Build wheels
4661 uses : PyO3/maturin-action@v1
4762 with :
4863 target : ${{ matrix.platform.target }}
49- args : --release --out dist -i 3.8 3.9 3.10 3.11 3.12 3.13 3.14 pypy3.11
64+ args : --release --out dist -i ${{ env.MATURIN_INTERPRETERS }}
5065 sccache : ' true'
5166 manylinux : auto
5267 - name : Upload wheels
@@ -72,13 +87,29 @@ jobs:
7287 - uses : actions/checkout@v4
7388 - uses : actions/setup-python@v5
7489 with :
75- python-version : 3.x
76- check-latest : true
90+ python-version : ' 3.x'
91+ - uses : actions/setup-python@v5
92+ id : setup_freethreaded
93+ continue-on-error : true
94+ with :
95+ python-version : |
96+ 3.13t
97+ 3.14t
98+ - name : Configure maturin interpreters
99+ shell : bash
100+ run : |
101+ INTERP='3.8 3.9 3.10 3.11 3.12 3.13 3.14'
102+ if [[ '${{ steps.setup_freethreaded.outcome }}' == 'success' ]]; then
103+ INTERP="$INTERP 3.13t 3.14t"
104+ else
105+ echo '::warning::Free-threaded Python (3.13t/3.14t) unavailable from setup-python; skipping cp313t/cp314t wheels this run.'
106+ fi
107+ echo "MATURIN_INTERPRETERS=$INTERP pypy3.11" >> "$GITHUB_ENV"
77108 - name : Build wheels
78109 uses : PyO3/maturin-action@v1
79110 with :
80111 target : ${{ matrix.platform.target }}
81- args : --release --out dist -i 3.8 3.9 3.10 3.11 3.12 3.13 3.14 pypy3.11
112+ args : --release --out dist -i ${{ env.MATURIN_INTERPRETERS }}
82113 sccache : ' true'
83114 manylinux : musllinux_1_2
84115 - name : Upload wheels
@@ -100,14 +131,31 @@ jobs:
100131 - uses : actions/checkout@v4
101132 - uses : actions/setup-python@v5
102133 with :
103- python-version : 3.x
134+ python-version : ' 3.x'
135+ architecture : ${{ matrix.platform.target }}
136+ - uses : actions/setup-python@v5
137+ id : setup_freethreaded
138+ continue-on-error : true
139+ with :
140+ python-version : |
141+ 3.13t
142+ 3.14t
104143 architecture : ${{ matrix.platform.target }}
105- check-latest : true
144+ - name : Configure maturin interpreters
145+ shell : bash
146+ run : |
147+ INTERP='3.8 3.9 3.10 3.11 3.12 3.13 3.14'
148+ if [[ '${{ steps.setup_freethreaded.outcome }}' == 'success' ]]; then
149+ INTERP="$INTERP 3.13t 3.14t"
150+ else
151+ echo '::warning::Free-threaded Python (3.13t/3.14t) unavailable from setup-python; skipping cp313t/cp314t wheels this run.'
152+ fi
153+ echo "MATURIN_INTERPRETERS=$INTERP" >> "$GITHUB_ENV"
106154 - name : Build wheels
107155 uses : PyO3/maturin-action@v1
108156 with :
109157 target : ${{ matrix.platform.target }}
110- args : --release --out dist -i 3.8 3.9 3.10 3.11 3.12 3.13 3.14
158+ args : --release --out dist -i ${{ env.MATURIN_INTERPRETERS }}
111159 sccache : ' true'
112160 - name : Upload wheels
113161 uses : actions/upload-artifact@v4
@@ -120,7 +168,7 @@ jobs:
120168 strategy :
121169 matrix :
122170 platform :
123- - runner : macos-13
171+ - runner : macos-15-intel
124172 target : x86_64
125173 - runner : macos-14
126174 target : aarch64
@@ -129,25 +177,72 @@ jobs:
129177 - uses : actions/setup-python@v5
130178 with :
131179 python-version : |
132- 3.9
133- 3.10
134- 3.11
135- 3.12
136- 3.13
137- 3.14
138- check-latest : true
180+ 3.9
181+ 3.10
182+ 3.11
183+ 3.12
184+ 3.13
185+ 3.14
186+ - uses : actions/setup-python@v5
187+ id : setup_freethreaded
188+ continue-on-error : true
189+ with :
190+ python-version : |
191+ 3.13t
192+ 3.14t
193+ - name : Configure maturin interpreters
194+ shell : bash
195+ run : |
196+ INTERP='3.8 3.9 3.10 3.11 3.12 3.13 3.14'
197+ if [[ '${{ steps.setup_freethreaded.outcome }}' == 'success' ]]; then
198+ INTERP="$INTERP 3.13t 3.14t"
199+ else
200+ echo '::warning::Free-threaded Python (3.13t/3.14t) unavailable from setup-python; skipping cp313t/cp314t wheels this run.'
201+ fi
202+ echo "MATURIN_INTERPRETERS=$INTERP pypy3.11" >> "$GITHUB_ENV"
139203 - name : Build wheels
140204 uses : PyO3/maturin-action@v1
141205 with :
142206 target : ${{ matrix.platform.target }}
143- args : --release --out dist -i 3.8 3.9 3.10 3.11 3.12 3.13 3.14 pypy3.11
207+ args : --release --out dist -i ${{ env.MATURIN_INTERPRETERS }}
144208 sccache : ' true'
145209 - name : Upload wheels
146210 uses : actions/upload-artifact@v4
147211 with :
148212 name : wheels-macos-${{ matrix.platform.target }}
149213 path : dist
150214
215+ free-threaded :
216+ runs-on : ubuntu-latest
217+ steps :
218+ - uses : actions/checkout@v4
219+ - uses : actions/setup-python@v5
220+ id : py314t
221+ continue-on-error : true
222+ with :
223+ python-version : ' 3.14t'
224+ - uses : actions/setup-python@v5
225+ id : py313t
226+ if : steps.py314t.outcome == 'failure'
227+ continue-on-error : true
228+ with :
229+ python-version : ' 3.13t'
230+ - uses : dtolnay/rust-toolchain@stable
231+ if : steps.py314t.outcome == 'success' || steps.py313t.outcome == 'success'
232+ - name : Install dependencies and build
233+ if : steps.py314t.outcome == 'success' || steps.py313t.outcome == 'success'
234+ run : |
235+ python -m pip install --upgrade pip
236+ pip install maturin pytest
237+ maturin develop --release
238+ - name : Run tests
239+ if : steps.py314t.outcome == 'success' || steps.py313t.outcome == 'success'
240+ run : pytest tests/
241+ - name : Free-threaded Python unavailable
242+ if : ${{ !(steps.py314t.outcome == 'success' || steps.py313t.outcome == 'success') }}
243+ run : |
244+ echo '::notice::No free-threaded Python (3.14t / 3.13t) available from setup-python for this runner; skipping extension tests.'
245+
151246 sdist :
152247 runs-on : ubuntu-latest
153248 steps :
@@ -167,7 +262,7 @@ jobs:
167262 name : Release
168263 runs-on : ubuntu-latest
169264 if : " startsWith(github.ref, 'refs/tags/')"
170- needs : [linux, musllinux, windows, macos, sdist]
265+ needs : [linux, musllinux, windows, macos, free-threaded, sdist]
171266 steps :
172267 - uses : actions/download-artifact@v4
173268 - name : Publish to PyPI
0 commit comments