Skip to content

Always use PyQT/PySide6 for GitHub CI #23597

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

Closed
wants to merge 1 commit into from
Closed
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
57 changes: 31 additions & 26 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
python-version: '3.11'
- os: macos-latest
python-version: 3.8
extra-requirements: '-r requirements/testing/extra.txt'

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -118,6 +119,8 @@ jobs:
brew install ccache
brew tap homebrew/cask-fonts
brew install font-noto-sans-cjk
brew install --cask inkscape
brew install gtk+3 gobject-introspection
;;
esac

Expand Down Expand Up @@ -185,44 +188,46 @@ jobs:
# (sometimes, the install appears to be successful but shared
# libraries cannot be loaded at runtime, so an actual import is a
# better check).
# PyGObject, pycairo, and cariocffi do not install on OSX 10.12.
python -m pip install --upgrade pycairo 'cairocffi>=0.8' PyGObject &&
python -m pip install --upgrade pycairo 'cairocffi>=0.8' &&
echo 'Cairo is available' ||
echo 'Cairo is not available'

# PyGObject does not install on OSX 11.6.
python -m pip install --upgrade PyGObject &&
python -c 'import gi; gi.require_version("Gtk", "3.0"); from gi.repository import Gtk' &&
echo 'PyGObject is available' ||
echo 'PyGObject is not available'

# There are no functioning wheels available for OSX 10.12 (as of
# Sept 2020) for either pyqt5 (there are only wheels for 10.13+) or
# pyside2 (the latest version (5.13.2) with 10.12 wheels has a
# fatal to us bug, it was fixed in 5.14.0 which has 10.13 wheels)
python -mpip install --upgrade pyqt5${{ matrix.pyqt5-ver }} &&
python -c 'import PyQt5.QtCore' &&
echo 'PyQt5 is available' ||
echo 'PyQt5 is not available'
python -mpip install --upgrade pyqt6${{ matrix.pyqt6-ver }} &&
python -c 'import PyQt6.QtCore' &&
echo 'PyQt6 is available' ||
echo 'PyQt6 is not available'
python -mpip install --upgrade pyside2${{ matrix.pyside2-ver }} &&
python -c 'import PySide2.QtCore' &&
echo 'PySide2 is available' ||
echo 'PySide2 is not available'
python -mpip install --upgrade pyside6${{ matrix.pyside6-ver }} &&
python -c 'import PySide6.QtCore' &&
echo 'PySide6 is available' ||
echo 'PySide6 is not available'

# No linux wheels in pypi, no working wheels for OSX
if [[ "${{ runner.os }}" != 'macOS' ]]; then
python -mpip install --upgrade pyside2${{ matrix.pyside2-ver }} &&
python -c 'import PySide2.QtCore' &&
echo 'PySide2 is available' ||
echo 'PySide2 is not available'
python -mpip install --upgrade \
-f "https://extras.wxpython.org/wxPython4/extras/linux/gtk3/${{ matrix.os }}" \
wxPython &&
python -c 'import wx' &&
echo 'wxPython is available' ||
echo 'wxPython is not available'
fi
if [[ "${{ matrix.os }}" = ubuntu-20.04 ]]; then
python -mpip install --upgrade pyqt6${{ matrix.pyqt6-ver }} &&
python -c 'import PyQt6.QtCore' &&
echo 'PyQt6 is available' ||
echo 'PyQt6 is not available'
python -mpip install --upgrade pyside6${{ matrix.pyside6-ver }} &&
python -c 'import PySide6.QtCore' &&
echo 'PySide6 is available' ||
echo 'PySide6 is not available'
if [[ "${{ runner.os }}" == 'macOS' ]]; then
echo 'wxPython is not available'
fi

python -mpip install --upgrade \
-f "https://extras.wxpython.org/wxPython4/extras/linux/gtk3/${{ matrix.os }}" \
wxPython &&
python -c 'import wx' &&
echo 'wxPython is available' ||
echo 'wxPython is not available'

- name: Install the nightly dependencies
# Only install the nightly dependencies during the scheduled event
if: ${{ github.event_name == 'schedule' && matrix.name-suffix != '(Minimum Versions)' }}
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/testing/_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ def _checkdep_usetex():
reason='xelatex + pgf is required')
needs_usetex = pytest.mark.skipif(
not _checkdep_usetex(),
reason="This test needs a TeX installation")
reason="This test needs a TeX installation with dvipng and ghostscript")
2 changes: 2 additions & 0 deletions lib/matplotlib/tests/test_backend_svg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
from io import BytesIO
from pathlib import Path
import sys
import xml.etree.ElementTree
import xml.parsers.expat

Expand Down Expand Up @@ -74,6 +75,7 @@ def test_bold_font_output():
ax.set_title('bold-title', fontweight='bold')


@pytest.mark.xfail(sys.platform == "darwin", reason='Fails on OSX')
@image_comparison(['bold_font_output_with_none_fonttype.svg'])
def test_bold_font_output_with_none_fonttype():
plt.rcParams['svg.fonttype'] = 'none'
Expand Down