@@ -88,14 +88,31 @@ jobs:
8888 pyqt6-ver : ' !=6.6.0'
8989 # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346
9090 pyside6-ver : ' !=6.5.1'
91- - os : macos-12 # This runnre is on Intel chips.
92- python-version : 3.9
91+ - os : ubuntu-22.04
92+ python-version : ' 3.13'
93+ # https://www.riverbankcomputing.com/pipermail/pyqt/2023-November/045606.html
94+ pyqt6-ver : ' !=6.6.0'
95+ # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346
96+ pyside6-ver : ' !=6.5.1'
97+ - name-suffix : " Free-threaded"
98+ os : ubuntu-22.04
99+ python-version : ' 3.13t'
100+ # https://www.riverbankcomputing.com/pipermail/pyqt/2023-November/045606.html
101+ pyqt6-ver : ' !=6.6.0'
102+ # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346
103+ pyside6-ver : ' !=6.5.1'
104+ - os : macos-12 # This runner is on Intel chips.
105+ python-version : ' 3.9'
93106 # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346
94107 pyside6-ver : ' !=6.5.1'
95108 - os : macos-14 # This runner is on M1 (arm64) chips.
96109 python-version : ' 3.12'
97110 # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346
98111 pyside6-ver : ' !=6.5.1'
112+ - os : macos-14 # This runner is on M1 (arm64) chips.
113+ python-version : ' 3.13'
114+ # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346
115+ pyside6-ver : ' !=6.5.1'
99116
100117 steps :
101118 - uses : actions/checkout@v4
@@ -104,8 +121,17 @@ jobs:
104121
105122 - name : Set up Python ${{ matrix.python-version }}
106123 uses : actions/setup-python@v5
124+ if : matrix.python-version != '3.13t'
107125 with :
108126 python-version : ${{ matrix.python-version }}
127+ allow-prereleases : true
128+
129+ - name : Set up Python ${{ matrix.python-version }}
130+ uses : deadsnakes/action@6c8b9b82fe0b4344f4b98f2775fcc395df45e494 # v3.1.0
131+ if : matrix.python-version == '3.13t'
132+ with :
133+ python-version : ' 3.13'
134+ nogil : true
109135
110136 - name : Install OS dependencies
111137 run : |
@@ -152,6 +178,11 @@ jobs:
152178 texlive-luatex \
153179 texlive-pictures \
154180 texlive-xetex
181+ if [[ "${{ matrix.python-version }}" = '3.13t' ]]; then
182+ # TODO: Remove this once setup-python supports nogil distributions.
183+ sudo apt-get install -yy --no-install-recommends \
184+ python3.13-tk-nogil
185+ fi
155186 if [[ "${{ matrix.os }}" = ubuntu-20.04 ]]; then
156187 sudo apt-get install -yy --no-install-recommends libopengl0
157188 else # ubuntu-22.04
@@ -202,6 +233,15 @@ jobs:
202233 4-${{ runner.os }}-py${{ matrix.python-version }}-mpl-${{ github.ref }}-
203234 4-${{ runner.os }}-py${{ matrix.python-version }}-mpl-
204235
236+ - name : Install the nightly dependencies
237+ if : matrix.python-version == '3.13t'
238+ run : |
239+ python -m pip install pytz tzdata python-dateutil # Must be installed for Pandas.
240+ python -m pip install \
241+ --pre \
242+ --index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
243+ --upgrade --only-binary=:all: numpy pandas pillow contourpy
244+
205245 - name : Install Python dependencies
206246 run : |
207247 # Upgrade pip and setuptools and wheel to get as clean an install as
@@ -227,6 +267,7 @@ jobs:
227267 # Sphinx is needed to run sphinxext tests
228268 python -m pip install --upgrade sphinx!=6.1.2
229269
270+ if [[ "${{ matrix.python-version }}" != '3.13t' ]]; then
230271 # GUI toolkits are pip-installable only for some versions of Python
231272 # so don't fail if we can't install them. Make it easier to check
232273 # whether the install was successful by trying to import the toolkit
@@ -246,11 +287,11 @@ jobs:
246287 python -c 'import PyQt5.QtCore' &&
247288 echo 'PyQt5 is available' ||
248289 echo 'PyQt5 is not available'
249- # Even though PySide2 wheels can be installed on Python 3.12, they are broken and since PySide2 is
290+ # Even though PySide2 wheels can be installed on Python 3.12+ , they are broken and since PySide2 is
250291 # deprecated, they are unlikely to be fixed. For the same deprecation reason, there are no wheels
251292 # on M1 macOS, so don't bother there either.
252293 if [[ "${{ matrix.os }}" != 'macos-14'
253- && "${{ matrix.python-version }}" != '3.12' ]]; then
294+ && "${{ matrix.python-version }}" != '3.12' && "${{ matrix.python-version }}" != '3.13' ]]; then
254295 python -mpip install --upgrade pyside2${{ matrix.pyside2-ver }} &&
255296 python -c 'import PySide2.QtCore' &&
256297 echo 'PySide2 is available' ||
@@ -272,6 +313,8 @@ jobs:
272313 echo 'wxPython is available' ||
273314 echo 'wxPython is not available'
274315
316+ fi # Skip backends on Python 3.13t.
317+
275318 - name : Install the nightly dependencies
276319 # Only install the nightly dependencies during the scheduled event
277320 if : github.event_name == 'schedule' && matrix.name-suffix != '(Minimum Versions)'
@@ -310,6 +353,9 @@ jobs:
310353
311354 - name : Run pytest
312355 run : |
356+ if [[ "${{ matrix.python-version }}" == '3.13t' ]]; then
357+ export PYTHON_GIL=0
358+ fi
313359 pytest -rfEsXR -n auto \
314360 --maxfail=50 --timeout=300 --durations=25 \
315361 --cov-report=xml --cov=lib --log-level=DEBUG --color=yes
0 commit comments