Skip to content

ci: Add Python 3.14b03 to the test matrix #30204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
contents: read
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }} ${{ matrix.name-suffix }}"
runs-on: ${{ matrix.os }}
continue-on-error: ${{ contains(matrix.name-suffix, 'pre-release') }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -75,6 +76,7 @@ jobs:
python-version: '3.13t'
# https://github.com/matplotlib/matplotlib/issues/29844
pygobject-ver: '<3.52.0'
skip-interactive-backend-builds: true
- os: ubuntu-24.04
python-version: '3.12'
- os: macos-13 # This runner is on Intel chips.
Expand All @@ -88,6 +90,10 @@ jobs:
python-version: '3.13'
# https://github.com/matplotlib/matplotlib/issues/29732
pygobject-ver: '<3.52.0'
- name-suffix: "(Python pre-release)"
os: ubuntu-24.04
python-version: '3.14-dev'
skip-interactive-backend-builds: true

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -226,6 +232,12 @@ jobs:
PRE="--pre"
fi

# On pre-release builds, use nightly wheels
if ${{ contains(matrix.name-suffix, 'pre-release') }}; then
PRE="--pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"
PRE+=" --prefer-binary"
fi

# Install dependencies from PyPI.
# Preinstall build requirements to enable no-build-isolation builds.
python -m pip install --upgrade $PRE \
Expand All @@ -239,7 +251,7 @@ jobs:
# Sphinx is needed to run sphinxext tests
python -m pip install --upgrade sphinx!=6.1.2

if [[ "${{ matrix.python-version }}" != '3.13t' ]]; then
if [[ "${{ matrix.skip-interactive-backend-builds }}" != "true" ]]; then
# GUI toolkits are pip-installable only for some versions of Python
# so don't fail if we can't install them. Make it easier to check
# whether the install was successful by trying to import the toolkit
Expand All @@ -265,8 +277,10 @@ jobs:
# Even though PySide2 wheels can be installed on Python 3.12+, they are broken and since PySide2 is
# deprecated, they are unlikely to be fixed. For the same deprecation reason, there are no wheels
# on M1 macOS, so don't bother there either.
if [[ "${{ matrix.os }}" != 'macos-14'
&& "${{ matrix.python-version }}" != '3.12' && "${{ matrix.python-version }}" != '3.13' ]]; then
version_atmost() {
printf "%s\n" "$1" "$2" | sort --version-sort --check=silent
}
if [[ "${{ matrix.os }}" != 'macos-14' ]] && version_atmost "${{ matrix.python-version }}" 3.11.999; then
python -mpip install --upgrade pyside2 &&
python -c 'import PySide2.QtCore' &&
echo 'PySide2 is available' ||
Expand All @@ -288,7 +302,7 @@ jobs:
echo 'wxPython is available' ||
echo 'wxPython is not available'

fi # Skip backends on Python 3.13t.
fi # skip-interactive-backend-builds

- name: Install the nightly dependencies
# Only install the nightly dependencies during the scheduled event
Expand Down Expand Up @@ -333,11 +347,17 @@ jobs:
if: matrix.delete-font-cache

- name: Run pytest
timeout-minutes: 90
run: |
if [[ "${{ matrix.python-version }}" == '3.13t' ]]; then
export PYTHON_GIL=0
fi
pytest -rfEsXR -n auto \
if "${{ contains(matrix.name-suffix, 'pre-release') }}"; then
FLAGS=(-k 'not test_backends_interactive')
else
FLAGS=()
fi
pytest -rfEsXR -n auto "${FLAGS[@]}" \
--maxfail=50 --timeout=300 --durations=25 \
--cov-report=xml --cov=lib --log-level=DEBUG --color=yes

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def subprocess_run_for_testing(command, env=None, timeout=60, stdout=None,
proc = subprocess.run(
command, env=env,
timeout=timeout, check=check,
stdout=stdout, stderr=stderr,
stdout=stdout, stderr=stderr, stdin=subprocess.DEVNULL,
text=text
)
except BlockingIOError:
Expand Down
Loading