language: python dist: xenial services: - xvfb branches: except: - /^auto-backport-of-pr-\d*/ - /^v\d+\.\d+\.[\dx]+-doc$/ cache: pip: true directories: - $HOME/.ccache # https://github.com/travis-ci/travis-ci/issues/5853 - $HOME/.cache/matplotlib addons: artifacts: paths: - result_images.tar.bz2 apt: packages: - cm-super - dvipng - ffmpeg - gdb - gir1.2-gtk-3.0 - graphviz - inkscape - lcov - libcairo2 - libcairo2-dev - libffi-dev - libgeos-dev - libgirepository1.0-dev - lmodern - fonts-freefont-otf - texlive-pictures - pkg-config - qtbase5-dev - texlive-fonts-recommended - texlive-latex-base - texlive-latex-extra - texlive-latex-recommended - texlive-luatex - texlive-xetex - ttf-wqy-zenhei env: global: - ARTIFACTS_AWS_REGION=us-east-1 - ARTIFACTS_BUCKET=matplotlib-test-results - secure: RgJI7BBL8aX5FTOQe7xiXqWHMxWokd6GNUWp1NUV2mRLXPb9dI0RXqZt3UJwKTAzf1z/OtlHDmEkBoTVK81E9iUxK5npwyyjhJ8yTJmwfQtQF2n51Q1Ww9p+XSLORrOzZc7kAo6Kw6FIXN1pfctgYq2bQkrwJPRx/oPR8f6hcbY= - secure: E7OCdqhZ+PlwJcn+Hd6ns9TDJgEUXiUNEI0wu7xjxB2vBRRIKtZMbuaZjd+iKDqCKuVOJKu0ClBUYxmgmpLicTwi34CfTUYt6D4uhrU+8hBBOn1iiK51cl/aBvlUUrqaRLVhukNEBGZcyqAjXSA/Qsnp2iELEmAfOUa92ZYo1sk= - secure: dfjNqGKzQG5bu3FnDNwLG8H/C4QoieFo4PfFmZPdM2RY7WIzukwKFNT6kiDfOrpwt+2bR7FhzjOGlDECGtlGOtYPN8XuXGjhcP4a4IfakdbDfF+D3NPIpf5VlE6776k0VpvcZBTMYJKNFIMc7QPkOwjvNJ2aXyfe3hBuGlKJzQU= - EXTRAREQS= # Location of an extra pip requirements file. - PINNEDVERS= # Location of a pip constraints file. # Variables controlling the test run. - DELETE_FONT_CACHE= - NO_AT_BRIDGE=1 # Necessary for GTK3 interactive test. - OPENBLAS_NUM_THREADS=1 - PYTHONFAULTHANDLER=1 - RUN_PYTEST=1 - RUN_FLAKE8= matrix: include: - name: flake8 python: 3.6 env: - RUN_PYTEST= - RUN_FLAKE8=1 - EXTRAREQS='-r requirements/testing/travis_flake8.txt' - python: 3.6 env: - PINNEDVERS='-c requirements/testing/travis36minver.txt' - DELETE_FONT_CACHE=1 - python: 3.7 env: - EXTRAREQS='-r requirements/testing/travis_extra.txt' - python: 3.8 env: - EXTRAREQS='-r requirements/testing/travis_extra.txt' - python: "nightly" env: - PRE=--pre - os: osx language: generic # https://github.com/travis-ci/travis-ci/issues/2312 only: master cache: # As for now travis caches only "$HOME/.cache/pip" # https://docs.travis-ci.com/user/caching/#pip-cache pip: false directories: - $HOME/Library/Caches/pip # `cache` does not support `env`-like `global` so copy-paste from top - $HOME/.ccache # https://github.com/travis-ci/travis-ci/issues/5853 - $HOME/.cache/matplotlib allow_failures: - python: "nightly" before_install: | case "$TRAVIS_OS_NAME" in linux) export PATH=/usr/lib/ccache:$PATH ;; osx) set -e ci/silence brew update brew uninstall numpy gdal postgis brew unlink python@2 brew upgrade python brew install ffmpeg imagemagick mplayer ccache hash -r which python python --version set +e # We could install ghostscript and inkscape here to test svg and pdf # but this makes the test time really long. # brew install ghostscript inkscape export PATH=/usr/local/opt/python/libexec/bin:/usr/local/opt/ccache/libexec:$PATH ;; esac install: - | # Setup environment. ccache -s git describe # Upgrade pip and setuptools and wheel to get as clean an install as possible. python -mpip install --upgrade pip setuptools wheel - | # Install dependencies from PyPI. python -mpip install --upgrade $PRE -r requirements/testing/travis_all.txt $EXTRAREQS $PINNEDVERS - | # Install optional dependencies from PyPI. # Sphinx is needed to run sphinxext tests python -mpip install --upgrade sphinx # GUI toolkits are pip-installable only for some versions of Python so # don't fail if we can't install them. Make it easier to check whether the # install was successful by trying to import the toolkit (sometimes, the # install appears to be successful but shared libraries cannot be loaded at # runtime, so an actual import is a better check). python -mpip install --upgrade pycairo cairocffi>=0.8 python -mpip 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' python -mpip install --upgrade pyqt5 && python -c 'import PyQt5.QtCore' && echo 'PyQt5 is available' || echo 'PyQt5 is not available' python -mpip install --upgrade pyside2 && 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/ubuntu-14.04 \ wxPython && python -c 'import wx' && echo 'wxPython is available' || echo 'wxPython is not available' # Set flag in a delayed manner to avoid issues with installing other packages - | if [[ $TRAVIS_OS_NAME != 'osx' ]] && [[ $RUN_PYTEST == 1 ]]; then export CPPFLAGS=--coverage fi - | python -mpip install -ve . # Install Matplotlib. - | if [[ $TRAVIS_OS_NAME != 'osx' ]] && [[ $RUN_PYTEST == 1 ]]; then unset CPPFLAGS fi before_script: | if [[ $DELETE_FONT_CACHE == 1 ]]; then rm -rf ~/.cache/matplotlib fi script: # Each script we want to run need to go in its own section and the program # you want to fail travis needs to be the last thing called. - | if [[ $RUN_PYTEST == 1 ]]; then # The number of processes is hardcoded (-n2), because using too many # causes the Travis VM to run out of memory (since so many copies of # inkscape and ghostscript are running at the same time). python -mpytest -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n2 --log-level=DEBUG fi - | if [[ $RUN_FLAKE8 == 1 ]]; then flake8 --statistics && echo "Flake8 passed without any issues!" fi before_cache: | rm -rf $HOME/.cache/matplotlib/tex.cache rm -rf $HOME/.cache/matplotlib/test_cache after_failure: | if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_REPO_SLUG == 'matplotlib/matplotlib' ]]; then tar cjf result_images.tar.bz2 result_images echo 'See "Uploading Artifacts" near the end of the log for the download URL' else echo "The result images will only be uploaded if they are on the matplotlib/matplotlib repo - this is for security reasons to prevent arbitrary PRs echoing security details." fi after_success: - lcov --capture --directory . --output-file coverage.info - lcov --remove coverage.info --output-file coverage.info '/usr/*' '/home/travis/build/matplotlib/matplotlib/build/*' '/home/travis/build/matplotlib/matplotlib/extern/*' # filter system-files - lcov --list coverage.info # Uploading to CodeCov but excluding gcov reports - bash <(curl -s https://codecov.io/bash) -f "!*.gcov" -X gcov -e TRAVIS_PYTHON_VERSION -y ci/codecov.yml|| echo "Codecov did not collect coverage reports"