Skip to content

Commit ebc393e

Browse files
Fix freethreaded Python 3.14 CI workflow
- Use setup-python with '3.14t' for freethreaded Python instead of manual downloads - Add GIL verification step - Simplify matrix configuration - Add shell: bash for cross-platform compatibility Amp-Thread-ID: https://ampcode.com/threads/T-fc74ca49-9112-45ec-bc0a-2d58b25ca7bf Co-authored-by: Amp <[email protected]>
1 parent 67c2ff3 commit ebc393e

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -150,36 +150,25 @@ jobs:
150150
include:
151151
- os: ubuntu-22.04
152152
python-version: '3.14.0'
153-
arch: x64
154-
platform: linux
155153
- os: windows-2022
156154
python-version: '3.14.0'
157-
arch: x64
158-
platform: win32
159155
- os: macos-14
160156
python-version: '3.14.0'
161-
arch: x64
162-
platform: darwin
163157
steps:
164158
- uses: actions/checkout@v4
165159
with:
166160
persist-credentials: false
167161

168-
- name: Download and setup Python ${{ matrix.python-version }} (freethreaded)
162+
- name: Set up Python ${{ matrix.python-version }} (freethreaded)
163+
uses: actions/[email protected]
164+
with:
165+
python-version: '3.14t'
166+
allow-prereleases: true
167+
168+
- name: Verify freethreaded Python
169+
shell: bash
169170
run: |
170-
if [ "${{ matrix.platform }}" = "linux" ]; then
171-
wget -O python.tar.gz "https://github.com/actions/python-versions/releases/download/3.14.0-18313368925/python-3.14.0-linux-22.04-${{ matrix.arch }}-freethreaded.tar.gz"
172-
tar -xzf python.tar.gz
173-
echo "$PWD/python-3.14.0-linux-22.04-${{ matrix.arch }}-freethreaded/bin" >> $GITHUB_PATH
174-
elif [ "${{ matrix.platform }}" = "win32" ]; then
175-
curl -L -o python.zip "https://github.com/actions/python-versions/releases/download/3.14.0-18313368925/python-3.14.0-win32-${{ matrix.arch }}-freethreaded.zip"
176-
Expand-Archive python.zip -DestinationPath .
177-
echo "$PWD/python-3.14.0-win32-${{ matrix.arch }}-freethreaded" >> $env:GITHUB_PATH
178-
elif [ "${{ matrix.platform }}" = "darwin" ]; then
179-
curl -L -o python.tar.gz "https://github.com/actions/python-versions/releases/download/3.14.0-18313368925/python-3.14.0-darwin-${{ matrix.arch }}-freethreaded.tar.gz"
180-
tar -xzf python.tar.gz
181-
echo "$PWD/python-3.14.0-darwin-${{ matrix.arch }}-freethreaded/bin" >> $GITHUB_PATH
182-
fi
171+
python -c "import sys; print(f'Python {sys.version}'); print(f'GIL enabled: {sys._is_gil_enabled()}' if hasattr(sys, '_is_gil_enabled') else 'GIL check not available')"
183172
184173
- name: Install uv
185174
uses: astral-sh/setup-uv@v6
@@ -196,6 +185,7 @@ jobs:
196185
uv pip install pytest pytest-xdist pytest-cov
197186
198187
- name: Create coverage directory
188+
shell: bash
199189
run: mkdir -p coverage/reports
200190

201191
- name: Run tests with freethreaded Python
@@ -211,7 +201,7 @@ jobs:
211201
with:
212202
directory: ./coverage/reports/
213203
env_vars: OS,PYTHON
214-
fail_ci_if_error: false # Don't fail CI if codecov upload fails
204+
fail_ci_if_error: false
215205
files: ./coverage/reports/coverage.xml
216206
flags: freethreaded
217207
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)