Skip to content

Commit

Permalink
Merge pull request #20307 from meeseeksmachine/auto-backport-of-pr-20…
Browse files Browse the repository at this point in the history
…154-on-v3.4.x

Backport PR #20154 on branch v3.4.x (ci: Bump Ubuntu to 18.04 LTS.)
  • Loading branch information
QuLogic committed May 26, 2021
2 parents 93a91ee + 1ef141e commit 02088df
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/tests.yml
Expand Up @@ -22,18 +22,18 @@ jobs:
matrix:
include:
- name-suffix: "(Minimum Versions)"
os: ubuntu-16.04
os: ubuntu-18.04
python-version: 3.7
extra-requirements: '-c requirements/testing/minver.txt'
pyqt5-ver: '==5.8 sip==4.19.7' # oldest versions with a Py3.7 wheel.
delete-font-cache: true
XVFB_RUN: xvfb-run -a
- os: ubuntu-16.04
- os: ubuntu-18.04
python-version: 3.7
extra-requirements: '-r requirements/testing/extra.txt'
XVFB_RUN: xvfb-run -a
CFLAGS: "-fno-lto" # Ensure that disabling LTO works.
- os: ubuntu-16.04
- os: ubuntu-18.04
python-version: 3.8
extra-requirements: '-r requirements/testing/extra.txt'
XVFB_RUN: xvfb-run -a
Expand Down Expand Up @@ -128,10 +128,10 @@ jobs:
~/.cache/matplotlib
!~/.cache/matplotlib/tex.cache
!~/.cache/matplotlib/test_cache
key: ${{ runner.os }}-py${{ matrix.python-version }}-mpl-${{ github.ref }}-${{ github.sha }}
key: 1-${{ runner.os }}-py${{ matrix.python-version }}-mpl-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-py${{ matrix.python-version }}-mpl-${{ github.ref }}-
${{ runner.os }}-py${{ matrix.python-version }}-mpl-
1-${{ runner.os }}-py${{ matrix.python-version }}-mpl-${{ github.ref }}-
1-${{ runner.os }}-py${{ matrix.python-version }}-mpl-
- name: Install Python dependencies
run: |
Expand All @@ -156,12 +156,8 @@ jobs:
# libraries cannot be loaded at runtime, so an actual import is a
# better check).
if [[ "${{ runner.os }}" != 'macOS' ]]; then
# PyGObject, pycairo, and cariocffi do not install on OSX 10.12;
# pycairo 1.20+ requires a new version of Cairo, unavailable on
# Ubuntu 16.04, so PyGObject must be installed without build
# isolation in order to pick up the lower pre-installed version.
python -m pip install --upgrade 'pycairo<1.20.0' 'cairocffi>=0.8' &&
python -m pip install --upgrade --no-build-isolation PyGObject &&
# PyGObject, pycairo, and cariocffi do not install on OSX 10.12.
python -m pip install --upgrade pycairo 'cairocffi>=0.8' 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'
Expand All @@ -180,7 +176,7 @@ jobs:
echo 'PySide2 is not available'
fi
python -m pip install --upgrade \
-f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 \
-f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 \
wxPython &&
python -c 'import wx' &&
echo 'wxPython is available' ||
Expand Down Expand Up @@ -226,3 +222,9 @@ jobs:
if: ${{ runner.os != 'macOS' }}
- name: Upload code coverage
uses: codecov/codecov-action@v1

- uses: actions/upload-artifact@v2
if: failure()
with:
name: "${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.name-suffix }} result images"
path: ./result_images
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Expand Up @@ -6,13 +6,13 @@
strategy:
matrix:
Linux_py37:
vmImage: 'ubuntu-16.04'
vmImage: 'ubuntu-18.04'
python.version: '3.7'
Linux_py38:
vmImage: 'ubuntu-16.04'
vmImage: 'ubuntu-18.04'
python.version: '3.8'
Linux_py39:
vmImage: 'ubuntu-16.04'
vmImage: 'ubuntu-18.04'
python.version: '3.9'
macOS_py37:
vmImage: 'macOS-10.15'
Expand Down
3 changes: 3 additions & 0 deletions lib/matplotlib/backends/backend_pgf.py
Expand Up @@ -968,6 +968,9 @@ def __init__(self, filename, *, keep_empty=True, metadata=None):
'Creator', 'Producer', 'CreationDate', 'ModDate', and
'Trapped'. Values have been predefined for 'Creator', 'Producer'
and 'CreationDate'. They can be removed by setting them to `None`.
Note that some versions of LaTeX engines may ignore the 'Producer'
key and set it to themselves.
"""
self._output_name = filename
self._n_figures = 0
Expand Down
Binary file not shown.
6 changes: 5 additions & 1 deletion lib/matplotlib/tests/test_backend_pgf.py
Expand Up @@ -257,13 +257,17 @@ def test_pdf_pages_metadata_check(monkeypatch, system):
if '/PTEX.Fullbanner' in info:
del info['/PTEX.Fullbanner']

# Some LaTeX engines ignore this setting, and state themselves as producer.
producer = info.pop('/Producer')
assert producer == f'Matplotlib pgf backend v{mpl.__version__}' or (
system == 'lualatex' and 'LuaTeX' in producer)

assert info == {
'/Author': 'me',
'/CreationDate': 'D:19700101000000Z',
'/Creator': f'Matplotlib v{mpl.__version__}, https://matplotlib.org',
'/Keywords': 'test,pdf,multipage',
'/ModDate': 'D:19680801000000Z',
'/Producer': f'Matplotlib pgf backend v{mpl.__version__}',
'/Subject': 'Test page',
'/Title': 'Multipage PDF with pgf',
'/Trapped': '/True',
Expand Down

0 comments on commit 02088df

Please sign in to comment.