diff --git a/.appveyor.yml b/.appveyor.yml index 668c5391de65..49611c66a254 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -23,13 +23,14 @@ environment: # In theory we could use a single CONDA_INSTALL_LOCN because we construct # the envs anyway. But using one for the right python version hopefully # making things faster due to package caching. - - PYTHON_VERSION: "3.6" - CONDA_INSTALL_LOCN: "C:\\Miniconda36-x64" + - PYTHON_VERSION: "3.7" + CONDA_INSTALL_LOCN: "C:\\Miniconda37-x64" TEST_ALL: "no" EXTRAREQS: "-r requirements/testing/travis_extra.txt" - - PYTHON_VERSION: "3.7" + - PYTHON_VERSION: "3.8" CONDA_INSTALL_LOCN: "C:\\Miniconda37-x64" TEST_ALL: "no" + EXTRAREQS: "-r requirements/testing/travis_extra.txt" # We always use a 64-bit machine, but can build x86 distributions # with the PYTHON_ARCH variable @@ -55,19 +56,15 @@ install: # For building, use a new environment - conda create -q -n test-environment python=%PYTHON_VERSION% tk - activate test-environment + # pull pywin32 from conda because on py38 there is something wrong with finding + # the dlls when insalled from pip + - conda install -c conda-forge pywin32 - echo %PYTHON_VERSION% %TARGET_ARCH% # Install dependencies from PyPI. - python -mpip install --upgrade -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 - - # Apply patch to `subprocess` on Python versions > 2 and < 3.6.3 - # https://github.com/matplotlib/matplotlib/issues/9176 - - python -c "import sys; sys.exit(not (3,) < sys.version_info < (3,6,3))" && ( - curl -sL https://github.com/python/cpython/pull/1224.patch | - patch -fsup 1 -d %CONDA_PREFIX% ) || cmd /c "exit /b 0" - # Show the installed packages + versions - conda list diff --git a/.circleci/config.yml b/.circleci/config.yml index 87388469caba..48275404c92e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,76 +4,105 @@ version: 2.1 -########################################### -# Define some common steps as YAML anchors. +####################################### +# Define some common steps as commands. # -apt-run: &apt-install - name: Install apt packages - command: | - sudo apt -qq update - sudo apt install -y \ - inkscape \ - ffmpeg \ - dvipng \ - lmodern \ - cm-super \ - texlive-latex-base \ - texlive-latex-extra \ - texlive-fonts-recommended \ - texlive-latex-recommended \ - texlive-pictures \ - texlive-xetex \ - graphviz \ - fonts-crosextra-carlito \ - fonts-freefont-otf \ - fonts-humor-sans \ - optipng - -fonts-run: &fonts-install - name: Install custom fonts - command: | - mkdir -p ~/.local/share/fonts - wget -nc https://github.com/google/fonts/blob/master/ofl/felipa/Felipa-Regular.ttf?raw=true -O ~/.local/share/fonts/Felipa-Regular.ttf || true - fc-cache -f -v - save_cache: - key: fonts-2 - paths: - - ~/.local/share/fonts/ - restore_cache: - key: fonts-2 - -pip-run: &pip-install - # Upgrade pip and setuptools and wheel to get as clean an install as possible - name: Upgrade pip, setuptools, wheel - command: | - python -mpip install --upgrade --user pip - python -mpip install --upgrade --user wheel - python -mpip install --upgrade --user setuptools - -deps-run: &deps-install - name: Install Python dependencies - command: | - python -mpip install --user numpy${NUMPY_VERSION} codecov coverage - python -mpip install --user -r requirements/doc/doc-requirements.txt - -mpl-run: &mpl-install - name: Install Matplotlib - command: python -mpip install --user -ve . - -doc-run: &doc-build - name: Build documentation - command: | - # Set epoch to date of latest tag. - export SOURCE_DATE_EPOCH="$(git log -1 --format=%at $(git describe --abbrev=0))" - make html O=-T - rm -r build/html/_sources - working_directory: doc - -doc-bundle-run: &doc-bundle - name: Bundle sphinx-gallery documentation artifacts - command: tar cf doc/build/sphinx-gallery-files.tar.gz doc/api/_as_gen doc/gallery doc/tutorials - when: always +commands: + apt-install: + steps: + - run: + name: Install apt packages + command: | + sudo apt -qq update + sudo apt install -y \ + inkscape \ + ffmpeg \ + dvipng \ + lmodern \ + cm-super \ + texlive-latex-base \ + texlive-latex-extra \ + texlive-fonts-recommended \ + texlive-latex-recommended \ + texlive-pictures \ + texlive-xetex \ + graphviz \ + fonts-crosextra-carlito \ + fonts-freefont-otf \ + fonts-humor-sans \ + optipng + + fonts-install: + steps: + - restore_cache: + key: fonts-2 + - run: + name: Install custom fonts + command: | + mkdir -p ~/.local/share/fonts + wget -nc https://github.com/google/fonts/blob/master/ofl/felipa/Felipa-Regular.ttf?raw=true -O ~/.local/share/fonts/Felipa-Regular.ttf || true + fc-cache -f -v + - save_cache: + key: fonts-2 + paths: + - ~/.local/share/fonts/ + + pip-install: + description: Upgrade pip and setuptools and wheel to get as clean an install as possible + steps: + - run: + name: Upgrade pip, setuptools, wheel + command: | + python -mpip install --upgrade --user pip + python -mpip install --upgrade --user wheel + python -mpip install --upgrade --user setuptools + + deps-install: + parameters: + numpy_version: + type: string + default: "" + steps: + - run: + name: Install Python dependencies + command: | + python -mpip install --user numpy<< parameters.numpy_version >> codecov coverage + python -mpip install --user -r requirements/doc/doc-requirements.txt + + mpl-install: + steps: + - run: + name: Install Matplotlib + command: python -mpip install --user -ve . + + doc-build: + steps: + - restore_cache: + keys: + - sphinx-env-v1-{{ .BuildNum }}-{{ .Environment.CIRCLE_JOB }} + - sphinx-env-v1-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}-{{ .Environment.CIRCLE_JOB }} + - run: + name: Build documentation + command: | + # Set epoch to date of latest tag. + export SOURCE_DATE_EPOCH="$(git log -1 --format=%at $(git describe --abbrev=0))" + make html O=-T + rm -r build/html/_sources + working_directory: doc + - save_cache: + key: sphinx-env-v1-{{ .BuildNum }}-{{ .Environment.CIRCLE_JOB }} + paths: + - doc/build/doctrees + + doc-bundle: + steps: + - run: + name: Bundle sphinx-gallery documentation artifacts + command: tar cf doc/build/sphinx-gallery-files.tar.gz doc/api/_as_gen doc/gallery doc/tutorials + when: always + - store_artifacts: + path: doc/build/sphinx-gallery-files.tar.gz ########################################## @@ -81,48 +110,43 @@ doc-bundle-run: &doc-bundle # jobs: - docs-python36: + docs-python37: docker: - - image: circleci/python:3.6 + - image: circleci/python:3.7 steps: - checkout - - run: *apt-install - - run: *fonts-install - - run: *pip-install - - run: - <<: *deps-install - environment: - NUMPY_VERSION: "==1.13.0" - - run: *mpl-install + - apt-install + - fonts-install + - pip-install - - run: *doc-build + - deps-install + - mpl-install - - run: *doc-bundle - - store_artifacts: - path: doc/build/sphinx-gallery-files.tar.gz + - doc-build + + - doc-bundle - store_artifacts: path: doc/build/html - docs-python37: + docs-python38-min: docker: - - image: circleci/python:3.7 + - image: circleci/python:3.8 steps: - checkout - - run: *apt-install - - run: *fonts-install - - run: *pip-install + - apt-install + - fonts-install + - pip-install - - run: *deps-install - - run: *mpl-install + - deps-install: + numpy_version: "==1.16.0" + - mpl-install - - run: *doc-build + - doc-build - - run: *doc-bundle - - store_artifacts: - path: doc/build/sphinx-gallery-files.tar.gz + - doc-bundle - store_artifacts: path: doc/build/html @@ -133,18 +157,16 @@ jobs: steps: - checkout - - run: *apt-install - - run: *fonts-install - - run: *pip-install + - apt-install + - fonts-install + - pip-install - - run: *deps-install - - run: *mpl-install + - deps-install + - mpl-install - - run: *doc-build + - doc-build - - run: *doc-bundle - - store_artifacts: - path: doc/build/sphinx-gallery-files.tar.gz + - doc-bundle - store_artifacts: path: doc/build/html @@ -164,6 +186,6 @@ workflows: version: 2 build: jobs: - - docs-python36 - docs-python37 - docs-python38 + - docs-python38-min diff --git a/.circleci/deploy-docs.sh b/.circleci/deploy-docs.sh index e6a51e58d8ad..83037d2561a4 100755 --- a/.circleci/deploy-docs.sh +++ b/.circleci/deploy-docs.sh @@ -2,8 +2,13 @@ set -e -if [ "$CIRCLE_PROJECT_USERNAME" != "matplotlib" -o "$CIRCLE_BRANCH" != "master" -o "$CIRCLE_PULL_REQUEST" != "" ]; then - echo "Not uploading docs from non-master branch or non-Matplotlib org." +if [ "$CIRCLE_PROJECT_USERNAME" != "matplotlib" ] || \ + [ "$CIRCLE_BRANCH" != "master" ] || \ + [[ "$CIRCLE_PULL_REQUEST" == https://github.com/matplotlib/matplotlib/pull/* ]]; then + echo "Not uploading docs for ${CIRCLE_SHA1}"\ + "from non-master branch (${CIRCLE_BRANCH})"\ + "or pull request (${CIRCLE_PULL_REQUEST})"\ + "or non-Matplotlib org (${CIRCLE_PROJECT_USERNAME})." exit fi diff --git a/.flake8 b/.flake8 index be20a443016d..4560fc4d319f 100644 --- a/.flake8 +++ b/.flake8 @@ -65,7 +65,6 @@ per-file-ignores = lib/matplotlib/pyplot.py: F401, F811 lib/matplotlib/style/__init__.py: F401 lib/matplotlib/testing/conftest.py: F401 - lib/matplotlib/testing/decorators.py: F401 lib/matplotlib/tests/conftest.py: F401 lib/matplotlib/tests/test_backend_qt.py: F401 lib/matplotlib/tests/test_mathtext.py: E501 @@ -158,6 +157,7 @@ per-file-ignores = examples/images_contours_and_fields/tripcolor_demo.py: E201, E402 examples/images_contours_and_fields/triplot_demo.py: E201, E402 examples/images_contours_and_fields/watermark_image.py: E402 + examples/lines_bars_and_markers/curve_error_band.py: E402 examples/lines_bars_and_markers/errorbar_limits_simple.py: E402 examples/lines_bars_and_markers/fill.py: E402 examples/lines_bars_and_markers/fill_between_demo.py: E402 @@ -225,6 +225,7 @@ per-file-ignores = examples/shapes_and_collections/ellipse_demo.py: E402 examples/shapes_and_collections/fancybox_demo.py: E402 examples/shapes_and_collections/hatch_demo.py: E402 + examples/shapes_and_collections/hatch_style_reference.py: E402 examples/shapes_and_collections/line_collection.py: E402 examples/shapes_and_collections/marker_path.py: E402 examples/shapes_and_collections/patch_collection.py: E402 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 677baee590db..8bc740303492 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,7 +7,7 @@ - [ ] New features are documented, with examples if plot related - [ ] Documentation is sphinx and numpydoc compliant - [ ] Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there) -- [ ] Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way +- [ ] Documented in doc/api/next_api_changes/* if API changed in a backward-incompatible way +