8000 Merge pull request #20233 from QuLogic/ubuntu20 · matplotlib/matplotlib@6cf9219 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6cf9219

Browse files
authored
Merge pull request #20233 from QuLogic/ubuntu20
Add a Ubuntu 20.04 / Python 3.9 CI run
2 parents c50a374 + e072e91 commit 6cf9219

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

.github/workflows/tests.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ jobs:
3737
python-version: 3.8
3838
extra-requirements: '-r requirements/testing/extra.txt'
3939
XVFB_RUN: xvfb-run -a
40+
- os: ubuntu-20.04
41+
python-version: 3.9
42+
extra-requirements: '-r requirements/testing/extra.txt'
43+
XVFB_RUN: xvfb-run -a
4044
- os: macos-latest
4145
python-version: 3.8
4246
XVFB_RUN: ""
@@ -176,7 +180,7 @@ jobs:
176180
echo 'PySide2 is not available'
177181
fi
178182
python -m pip install --upgrade \
179-
-f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 \
183+
-f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-$(lsb_release -r -s) \
180184
wxPython &&
181185
python -c 'import wx' &&
182186
echo 'wxPython is available' ||
@@ -190,7 +194,11 @@ jobs:
190194
# Set flag in a delayed manner to avoid issues with installing other
191195
# packages
192196
if [[ "${{ runner.os }}" != 'macOS' ]]; then
193-
export CPPFLAGS=--coverage
197+
if [[ "$(lsb_release -r -s)" == "20.04" ]]; then
198+
export CPPFLAGS='--coverage -fprofile-abs-path'
199+
else
200+
export CPPFLAGS='--coverage'
201+
fi
194202
fi
195203
196204
# All dependencies must have been pre-installed, so that the minver
Binary file not shown.
Binary file not shown.
Binary file not shown.

lib/matplotlib/tests/test_backend_pgf.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,18 @@ def test_xelatex():
8787
create_figure()
8888

8989

90+
try:
91+
_old_gs_version = mpl._get_executable_info('gs').version < '9.50'
92+
except mpl.ExecutableNotFoundError:
93+
_old_gs_version = True
94+
95+
9096
# test compiling a figure to pdf with pdflatex
9197
@needs_pdflatex
9298
@pytest.mark.skipif(not _has_tex_package('ucs'), reason='needs ucs.sty')
9399
@pytest.mark.backend('pgf')
94-
@image_comparison(['pgf_pdflatex.pdf'], style='default')
100+
@image_comparison(['pgf_pdflatex.pdf'], style='default',
101+
tol=11.7 if _old_gs_version else 0)
95102
def test_pdflatex():
96103
if os.environ.get('APPVEYOR'):
97104
pytest.xfail("pdflatex test does not work on appveyor due to missing "
@@ -127,15 +134,15 @@ def test_rcupdate():
127134
'pgf.preamble': ('\\usepackage[utf8x]{inputenc}'
128135
'\\usepackage[T1]{fontenc}'
129136
'\\usepackage{sfmath}')}]
130-
tol = [6, 0]
137+
tol = [0, 13.2] if _old_gs_version else [0, 0]
131138
for i, rc_set in enumerate(rc_sets):
132139
with mpl.rc_context(rc_set):
133140
for substring, pkg in [('sfmath', 'sfmath'), ('utf8x', 'ucs')]:
134141
if (substring in mpl.rcParams['pgf.preamble']
135142
and not _has_tex_package(pkg)):
136143
pytest.skip(f'needs {pkg}.sty')
137144
create_figure()
138-
compare_figure('pgf_rcupdate%d.pdf' % (i + 1), tol=tol[i])
145+
compare_figure(f'pgf_rcupdate{i + 1}.pdf', tol=tol[i])
139146

140147

141148
# test backend-side clipping, since large numbers are not supported by TeX

0 commit comments

Comments
 (0)
0