Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a05a264

Browse files
anntzertacaswell
authored andcommitted
Restrict Qt6 CI to Ubuntu 20.04.
Also, PyGObjects built on different Ubuntus are incompatible, so the cache should be keyed by matrix.os (which includes the version number), not runner.os (which doesn't).
1 parent 197d944 commit a05a264

File tree

2 files changed

+41
-24
lines changed

2 files changed

+41
-24
lines changed

.github/workflows/tests.yml

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ jobs:
9595
texlive-luatex \
9696
texlive-xetex \
9797
ttf-wqy-zenhei
98+
if [[ "${{ matrix.os }}" = ubuntu-20.04 ]]; then
99+
sudo apt install -yy libopengl0
100+
fi
98101
;;
99102
macOS)
100103
brew install ccache
@@ -106,25 +109,25 @@ jobs:
106109
if: startsWith(runner.os, 'Linux')
107110
with:
108111
path: ~/.cache/pip
109-
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements/*/*.txt') }}
112+
key: ${{ matrix.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements/*/*.txt') }}
110113
restore-keys: |
111-
${{ runner.os }}-py${{ matrix.python-version }}-pip-
114+
${{ matrix.os }}-py${{ matrix.python-version }}-pip-
112115
- name: Cache pip
113116
uses: actions/cache@v2
114117
if: startsWith(runner.os, 'macOS')
115118
with:
116119
path: ~/Library/Caches/pip
117-
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements/*/*.txt') }}
120+
key: ${{ matrix.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements/*/*.txt') }}
118121
restore-keys: |
119-
${{ runner.os }}-py${{ matrix.python-version }}-pip-
122+
${{ matrix.os }}-py${{ matrix.python-version }}-pip-
120123
- name: Cache ccache
121124
uses: actions/cache@v2
122125
with:
123126
path: |
124127
~/.ccache
125-
key: ${{ runner.os }}-py${{ matrix.python-version }}-ccache-${{ hashFiles('src/*') }}
128+
key: ${{ matrix.os }}-py${{ matrix.python-version }}-ccache-${{ hashFiles('src/*') }}
126129
restore-keys: |
127-
${{ runner.os }}-py${{ matrix.python-version }}-ccache-
130+
${{ matrix.os }}-py${{ matrix.python-version }}-ccache-
128131
- name: Cache Matplotlib
129132
uses: actions/cache@v2
130133
with:
@@ -171,25 +174,28 @@ jobs:
171174
# Sept 2020) for either pyqt5 (there are only wheels for 10.13+) or
172175
# pyside2 (the latest version (5.13.2) with 10.12 wheels has a
173176
# fatal to us bug, it was fixed in 5.14.0 which has 10.13 wheels)
174-
python -m pip install --upgrade pyqt5${{ matrix.pyqt5-ver }} &&
175-
python -c 'import PyQt5.QtCore' &&
176-
echo 'PyQt5 is available' ||
177-
echo 'PyQt5 is not available'
178-
python -m pip install --upgrade pyside2 &&
179-
python -c 'import PySide2.QtCore' &&
180-
echo 'PySide2 is available' ||
181-
echo 'PySide2 is not available'
182-
python -mpip install --upgrade pyqt6 &&
183-
python -c 'import PyQt6.QtCore' &&
184-
echo 'PyQt6 is available' ||
185-
echo 'PyQt6 is not available'
186-
python -mpip install --upgrade pyside6 &&
187-
python -c 'import PySide6.QtCore' &&
188-
echo 'PySide6 is available' ||
189-
echo 'PySide6 is not available'
177+
python -mpip install --upgrade pyqt5${{ matrix.pyqt5-ver }} &&
178+
python -c 'import PyQt5.QtCore' &&
179+
echo 'PyQt5 is available' ||
180+
echo 'PyQt5 is not available'
181+
python -mpip install --upgrade pyside2 &&
182+
python -c 'import PySide2.QtCore' &&
183+
echo 'PySide2 is available' ||
184+
echo 'PySide2 is not available'
185+
# Qt6 crashes on Github's ubuntu 18.04 runner.
186+
if [[ "${{ matrix.os }}" = ubuntu-20.04 ]]; then
187+
python -mpip install --upgrade pyqt6 &&
188+
python -c 'import PyQt6.QtCore' &&
189+
echo 'PyQt6 is available' ||
190+
echo 'PyQt6 is not available'
191+
python -mpip install --upgrade pyside6 &&
192+
python -c 'import PySide6.QtCore' &&
193+
echo 'PySide6 is available' ||
194+
echo 'PySide6 is not available'
195+
fi
190196
fi
191-
python -m pip install --upgrade \
192-
-f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-$(lsb_release -r -s) \
197+
python -mpip install --upgrade \
198+
-f "https://extras.wxpython.org/wxPython4/extras/linux/gtk3/${{ matrix.os }}" \
193199
wxPython &&
194200
python -c 'import wx' &&
195201
echo 'wxPython is available' ||

lib/matplotlib/tests/test_sphinxext.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ def test_tinypages(tmpdir):
1818
shutil.copytree(Path(__file__).parent / 'tinypages', source_dir)
1919
html_dir = source_dir / '_build' / 'html'
2020
doctree_dir = source_dir / 'doctrees'
21+
# Build the pages with warnings turned into errors
22+
cmd = [sys.executable, '-msphinx', '-W', '-b', 'html',
23+
'-d', str(doctree_dir),
24+
str(Path(__file__).parent / 'tinypages'), str(html_dir)]
25+
# On CI, gcov emits warnings (due to agg headers being included with the
26+
# same name in multiple extension modules -- but we don't care about their
27+
# coverage anyways); hide them using GCOV_ERROR_FILE.
28+
proc = Popen(
29+
cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True,
30+
env={**os.environ, "MPLBACKEND": "", "GCOV_ERROR_FILE": os.devnull})
31+
out, err = proc.communicate()
2132

2233
# Build the pages with warnings turned into errors
2334
build_sphinx_html(source_dir, doctree_dir, html_dir)

0 commit comments

Comments
 (0)