Skip to content

Commit 613fced

Browse files
authored
Merge pull request #8200 from hugovk/ci-free-threading
Test 3.13 free-threaded build on CI
2 parents 94a8fcc + 77e752f commit 613fced

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

.ci/install.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,18 @@ python3 -m pip install -U pytest-timeout
3737
python3 -m pip install pyroma
3838

3939
if [[ $(uname) != CYGWIN* ]]; then
40-
python3 -m pip install numpy
40+
# TODO Update condition when NumPy supports free-threading
41+
if [[ "$PYTHON_GIL" == "0" ]]; then
42+
python3 -m pip install numpy --index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
43+
else
44+
python3 -m pip install numpy
45+
fi
4146

4247
# PyQt6 doesn't support PyPy3
4348
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then
4449
sudo apt-get -qq install libegl1 libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxkbcommon-x11-0
45-
python3 -m pip install pyqt6
50+
# TODO Update condition when pyqt6 supports free-threading
51+
if ! [[ "$PYTHON_GIL" == "0" ]]; then python3 -m pip install pyqt6 ; fi
4652
fi
4753

4854
# Pyroma uses non-isolated build and fails with old setuptools

.github/workflows/test.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,24 @@ jobs:
5050
"3.9",
5151
]
5252
include:
53-
- python-version: "3.11"
54-
PYTHONOPTIMIZE: 1
55-
REVERSE: "--reverse"
56-
- python-version: "3.10"
57-
PYTHONOPTIMIZE: 2
53+
- { python-version: "3.11", PYTHONOPTIMIZE: 1, REVERSE: "--reverse" }
54+
- { python-version: "3.10", PYTHONOPTIMIZE: 2 }
55+
# Free-threaded
56+
- { os: "ubuntu-latest", python-version: "3.13-dev", disable-gil: true }
5857
# M1 only available for 3.10+
59-
- os: "macos-13"
60-
python-version: "3.9"
58+
- { os: "macos-13", python-version: "3.9" }
6159
exclude:
62-
- os: "macos-14"
63-
python-version: "3.9"
60+
- { os: "macos-14", python-version: "3.9" }
6461

6562
runs-on: ${{ matrix.os }}
66-
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
63+
name: ${{ matrix.os }} Python ${{ matrix.python-version }} ${{ matrix.disable-gil && 'free-threaded' || '' }}
6764

6865
steps:
6966
- uses: actions/checkout@v4
7067

7168
- name: Set up Python ${{ matrix.python-version }}
7269
uses: actions/setup-python@v5
70+
if: "${{ !matrix.disable-gil }}"
7371
with:
7472
python-version: ${{ matrix.python-version }}
7573
allow-prereleases: true
@@ -78,6 +76,18 @@ jobs:
7876
".ci/*.sh"
7977
"pyproject.toml"
8078
79+
- name: Set up Python ${{ matrix.python-version }} (free-threaded)
80+
uses: deadsnakes/[email protected]
81+
if: "${{ matrix.disable-gil }}"
82+
with:
83+
python-version: ${{ matrix.python-version }}
84+
nogil: ${{ matrix.disable-gil }}
85+
86+
- name: Set PYTHON_GIL
87+
if: "${{ matrix.disable-gil }}"
88+
run: |
89+
echo "PYTHON_GIL=0" >> $GITHUB_ENV
90+
8191
- name: Build system information
8292
run: python3 .github/workflows/system-info.py
8393

0 commit comments

Comments
 (0)