diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e5d7e064f55e..c5e532ec7217 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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: | @@ -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' @@ -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' || @@ -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 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2ff87d0c71da..2c25a7786288 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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' diff --git a/lib/matplotlib/backends/backend_pgf.py b/lib/matplotlib/backends/backend_pgf.py index 9d01f603e021..522418544bd1 100644 --- a/lib/matplotlib/backends/backend_pgf.py +++ b/lib/matplotlib/backends/backend_pgf.py @@ -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 diff --git a/lib/matplotlib/tests/baseline_images/test_backend_pgf/pgf_mixedmode.pdf b/lib/matplotlib/tests/baseline_images/test_backend_pgf/pgf_mixedmode.pdf index fdbb20349c42..fd7cf7a5c0d1 100644 Binary files a/lib/matplotlib/tests/baseline_images/test_backend_pgf/pgf_mixedmode.pdf and b/lib/matplotlib/tests/baseline_images/test_backend_pgf/pgf_mixedmode.pdf differ diff --git a/lib/matplotlib/tests/test_backend_pgf.py b/lib/matplotlib/tests/test_backend_pgf.py index 75f50ecbf0d9..040b2e714655 100644 --- a/lib/matplotlib/tests/test_backend_pgf.py +++ b/lib/matplotlib/tests/test_backend_pgf.py @@ -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',