From 3f19e8cba995c2faa4f6ffbc275e9d2395c05552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Sat, 21 Jun 2025 17:30:39 +0300 Subject: [PATCH 1/2] Add Python 3.14b03 to the test matrix With continue-on-error set so failures don't break the build Co-authored-by: Oscar Gustafsson --- .github/workflows/tests.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 85ace93445b6..f765d8acac00 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -88,6 +89,9 @@ 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' steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -226,6 +230,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 \ @@ -265,8 +275,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' || @@ -333,6 +345,7 @@ jobs: if: matrix.delete-font-cache - name: Run pytest + timeout-minutes: 90 run: | if [[ "${{ matrix.python-version }}" == '3.13t' ]]; then export PYTHON_GIL=0 From 8b983dd60315546579f18bd80c3f78213157e1ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Wed, 2 Jul 2025 06:45:07 +0300 Subject: [PATCH 2/2] Skip interactive backends in 3.14 tests The dependency wheels are not available for 3.14, and the tkagg tests fail by running into timeouts. Use the same if statement already used for 3.13t. Also skip interactive-backend tests on the 3.14 pre-release. --- .github/workflows/tests.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f765d8acac00..7084c3ffba4a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -76,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. @@ -92,6 +93,7 @@ jobs: - 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 @@ -249,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 @@ -300,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 @@ -350,7 +352,12 @@ jobs: 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