Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 55363b6

Browse files
QuLogicandfoy
andcommitted
CI: Add CI to test matplotlib against free-threaded Python
Co-authored-by: Edgar Andrés Margffoy Tuay <[email protected]>
1 parent f96b4f3 commit 55363b6

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/tests.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ jobs:
9191
pyqt6-ver: '!=6.6.0'
9292
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346
9393
pyside6-ver: '!=6.5.1'
94+
- name-suffix: "Free-threaded"
95+
os: ubuntu-22.04
96+
python-version: '3.13t'
97+
# https://www.riverbankcomputing.com/pipermail/pyqt/2023-November/045606.html
98+
pyqt6-ver: '!=6.6.0'
99+
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346
100+
pyside6-ver: '!=6.5.1'
94101
- os: macos-12 # This runner is on Intel chips.
95102
python-version: '3.10'
96103
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346
@@ -111,10 +118,18 @@ jobs:
111118

112119
- name: Set up Python ${{ matrix.python-version }}
113120
uses: actions/setup-python@v5
121+
if: matrix.python-version != '3.13t'
114122
with:
115123
python-version: ${{ matrix.python-version }}
116124
allow-prereleases: true
117125

126+
- name: Set up Python ${{ matrix.python-version }}
127+
uses: deadsnakes/action@6c8b9b82fe0b4344f4b98f2775fcc395df45e494 # v3.1.0
128+
if: matrix.python-version == '3.13t'
129+
with:
130+
python-version: '3.13'
131+
nogil: true
132+
118133
- name: Install OS dependencies
119134
run: |
120135
case "${{ runner.os }}" in
@@ -160,6 +175,11 @@ jobs:
160175
texlive-luatex \
161176
texlive-pictures \
162177
texlive-xetex
178+
if [[ "${{ matrix.python-version }}" = '3.13t' ]]; then
179+
# TODO: Remove this once setup-python supports nogil distributions.
180+
sudo apt-get install -yy --no-install-recommends \
181+
python3.13-tk-nogil
182+
fi
163183
if [[ "${{ matrix.os }}" = ubuntu-20.04 ]]; then
164184
sudo apt-get install -yy --no-install-recommends libopengl0
165185
else # ubuntu-22.04
@@ -210,6 +230,15 @@ jobs:
210230
4-${{ runner.os }}-py${{ matrix.python-version }}-mpl-${{ github.ref }}-
211231
4-${{ runner.os }}-py${{ matrix.python-version }}-mpl-
212232
233+
- name: Install the nightly dependencies
234+
if: matrix.python-version == '3.13t'
235+
run: |
236+
python -m pip install pytz tzdata python-dateutil # Must be installed for Pandas.
237+
python -m pip install \
238+
--pre \
239+
--index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
240+
--upgrade --only-binary=:all: numpy pandas pillow contourpy
241+
213242
- name: Install Python dependencies
214243
run: |
215244
# Upgrade pip and setuptools and wheel to get as clean an install as
@@ -235,6 +264,7 @@ jobs:
235264
# Sphinx is needed to run sphinxext tests
236265
python -m pip install --upgrade sphinx!=6.1.2
237266
267+
if [[ "${{ matrix.python-version }}" != '3.13t' ]]; then
238268
# GUI toolkits are pip-installable only for some versions of Python
239269
# so don't fail if we can't install them. Make it easier to check
240270
# whether the install was successful by trying to import the toolkit
@@ -280,6 +310,8 @@ jobs:
280310
echo 'wxPython is available' ||
281311
echo 'wxPython is not available'
282312
313+
fi # Skip backends on Python 3.13t.
314+
283315
- name: Install the nightly dependencies
284316
# Only install the nightly dependencies during the scheduled event
285317
if: github.event_name == 'schedule' && matrix.name-suffix != '(Minimum Versions)'
@@ -318,6 +350,9 @@ jobs:
318350

319351
- name: Run pytest
320352
run: |
353+
if [[ "${{ matrix.python-version }}" == '3.13t' ]]; then
354+
export PYTHON_GIL=0
355+
fi
321356
pytest -rfEsXR -n auto \
322357
--maxfail=50 --timeout=300 --durations=25 \
323358
--cov-report=xml --cov=lib --log-level=DEBUG --color=yes

0 commit comments

Comments
 (0)