diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 85ace93445b6..7084c3ffba4a 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 @@ -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. @@ -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 @@ -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 \ @@ -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 @@ -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' || @@ -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 @@ -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