Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6db13c7

Browse files
authored
Merge branch 'main' into fallback-revamp
2 parents 4426c60 + 5f0e6df commit 6db13c7

600 files changed

Lines changed: 29523 additions & 21121 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ install:
6060
# pull pywin32 from conda because on py38 there is something wrong with finding
6161
# the dlls when insalled from pip
6262
- conda install -c conda-forge pywin32
63+
# install pyqt from conda-forge
64+
- conda install -c conda-forge pyqt
6365
- echo %PYTHON_VERSION% %TARGET_ARCH%
6466
# Install dependencies from PyPI.
6567
- python -m pip install --upgrade -r requirements/testing/all.txt %EXTRAREQS% %PINNEDVERS%

.circleci/config.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ commands:
3131
git remote add upstream git://github.com/matplotlib/matplotlib.git
3232
fi
3333
git fetch upstream
34-
if [[ "$CIRCLE_BRANCH" != "master" ]] && \
34+
if [[ "$CIRCLE_BRANCH" != "main" ]] && \
3535
[[ "$CIRCLE_PR_NUMBER" != "" ]]; then
3636
echo "Merging ${CIRCLE_PR_NUMBER}"
3737
git pull --ff-only upstream "refs/pull/${CIRCLE_PR_NUMBER}/merge"
@@ -59,6 +59,7 @@ commands:
5959
fonts-crosextra-carlito \
6060
fonts-freefont-otf \
6161
fonts-humor-sans \
62+
fonts-noto-cjk \
6263
optipng
6364
6465
fonts-install:
@@ -104,6 +105,13 @@ commands:
104105
- run:
105106
name: Install Matplotlib
106107
command: python -m pip install --user -ve .
108+
- save_cache:
109+
key: build-deps-1
110+
paths:
111+
# FreeType 2.6.1 tarball.
112+
- ~/.cache/matplotlib/0a3c7dfbda6da1e8fce29232e8e96d987ababbbf71ebc8c75659e4132c367014
113+
# Qhull 2020.2 tarball.
114+
- ~/.cache/matplotlib/b5c2d7eb833278881b952c8a52d20179eab87766b00b865000469a45c1838b7e
107115

108116
doc-build:
109117
steps:
@@ -116,15 +124,13 @@ commands:
116124
command: |
117125
# Set epoch to date of latest tag.
118126
export SOURCE_DATE_EPOCH="$(git log -1 --format=%at $(git describe --abbrev=0))"
119-
# Include analytics only when deploying to devdocs.
120-
if [ "$CIRCLE_PROJECT_USERNAME" != "matplotlib" ] || \
121-
[ "$CIRCLE_BRANCH" != "master" ] || \
122-
[[ "$CIRCLE_PULL_REQUEST" == https://github.com/matplotlib/matplotlib/pull/* ]]; then
123-
export ANALYTICS=False
124-
else
125-
export ANALYTICS=True
127+
# Set release mode only when deploying to devdocs.
128+
if [ "$CIRCLE_PROJECT_USERNAME" = "matplotlib" ] && \
129+
[ "$CIRCLE_BRANCH" = "main" ] && \
130+
[ "$CIRCLE_PR_NUMBER" = "" ]; then
131+
export RELEASE_TAG='-t release'
126132
fi
127-
make html O="-T -Ainclude_analytics=$ANALYTICS"
133+
make html O="-T $RELEASE_TAG"
128134
rm -r build/html/_sources
129135
working_directory: doc
130136
- save_cache:
@@ -149,7 +155,7 @@ commands:
149155
jobs:
150156
docs-python38:
151157
docker:
152-
- image: circleci/python:3.8
158+
- image: cimg/python:3.8
153159
steps:
154160
- checkout
155161
- check-skip

.circleci/deploy-docs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
set -e
44

55
if [ "$CIRCLE_PROJECT_USERNAME" != "matplotlib" ] || \
6-
[ "$CIRCLE_BRANCH" != "master" ] || \
6+
[ "$CIRCLE_BRANCH" != "main" ] || \
77
[[ "$CIRCLE_PULL_REQUEST" == https://github.com/matplotlib/matplotlib/pull/* ]]; then
88
echo "Not uploading docs for ${CIRCLE_SHA1}"\
9-
"from non-master branch (${CIRCLE_BRANCH})"\
9+
"from non-main branch (${CIRCLE_BRANCH})"\
1010
"or pull request (${CIRCLE_PULL_REQUEST})"\
1111
"or non-Matplotlib org (${CIRCLE_PROJECT_USERNAME})."
1212
exit

.flake8

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ per-file-ignores =
4545
setupext.py: E501
4646
tests.py: F401
4747

48-
lib/matplotlib/__init__.py: F401
48+
lib/matplotlib/__init__.py: E402, F401
4949
lib/matplotlib/_api/__init__.py: F401
5050
lib/matplotlib/_cm.py: E122, E202, E203, E302
5151
lib/matplotlib/_mathtext.py: E221, E251
@@ -85,7 +85,7 @@ per-file-ignores =
8585
lib/mpl_toolkits/tests/conftest.py: F401
8686
lib/pylab.py: F401, F403
8787

88-
doc/conf.py: E402, E501
88+
doc/conf.py: E402
8989
tutorials/advanced/path_tutorial.py: E402
9090
tutorials/advanced/patheffects_guide.py: E402
9191
tutorials/advanced/transforms_tutorial.py: E402, E501
@@ -120,11 +120,15 @@ per-file-ignores =
120120
examples/style_sheets/plot_solarizedlight2.py: E501
121121
examples/subplots_axes_and_figures/demo_constrained_layout.py: E402
122122
examples/text_labels_and_annotations/custom_legends.py: E402
123-
examples/ticks_and_spines/date_concise_formatter.py: E402
123+
examples/ticks/date_concise_formatter.py: E402
124124
examples/user_interfaces/embedding_in_gtk3_panzoom_sgskip.py: E402
125125
examples/user_interfaces/embedding_in_gtk3_sgskip.py: E402
126-
examples/user_interfaces/gtk_spreadsheet_sgskip.py: E402
126+
examples/user_interfaces/embedding_in_gtk4_panzoom_sgskip.py: E402
127+
examples/user_interfaces/embedding_in_gtk4_sgskip.py: E402
128+
examples/user_interfaces/gtk3_spreadsheet_sgskip.py: E402
129+
examples/user_interfaces/gtk4_spreadsheet_sgskip.py: E402
127130
examples/user_interfaces/mpl_with_glade3_sgskip.py: E402
128-
examples/user_interfaces/pylab_with_gtk_sgskip.py: E402
131+
examples/user_interfaces/pylab_with_gtk3_sgskip.py: E402
132+
examples/user_interfaces/pylab_with_gtk4_sgskip.py: E402
129133
examples/user_interfaces/toolmanager_sgskip.py: E402
130134
examples/userdemo/pgf_preamble_sgskip.py: E402

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# These are supported funding model platforms
2-
github: [numfocus]
2+
github: [matplotlib, numfocus]
33
custom: https://numfocus.org/donate-to-matplotlib

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ consider the following points:
2121
- Help with git and github is available at
2222
https://matplotlib.org/devel/gitwash/development_workflow.html.
2323
24-
- Do not create the PR out of master, but out of a separate branch.
24+
- Do not create the PR out of main, but out of a separate branch.
2525
2626
- The PR title should summarize the changes, for example "Raise ValueError on
2727
non-numeric input to set_xlim". Avoid non-descriptive titles such as

.github/workflows/cibuildwheel.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build CI wheels
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
- v[0-9]+.[0-9]+.x
88
tags:
99
- v*
@@ -15,9 +15,10 @@ jobs:
1515
env:
1616
min-numpy-version: "1.17.3"
1717
min-numpy-hash: "b6/d6/be8f975f5322336f62371c9abeb936d592c98c047ad63035f1b38ae08efe"
18+
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
1819
strategy:
1920
matrix:
20-
os: [ubuntu-18.04, windows-latest, macos-latest]
21+
os: [ubuntu-18.04, windows-latest, macos-10.15]
2122
cibw_archs: ["auto"]
2223
include:
2324
- os: ubuntu-18.04
@@ -47,7 +48,7 @@ jobs:
4748

4849
- name: Install cibuildwheel
4950
run: |
50-
python -m pip install cibuildwheel==1.9.0
51+
python -m pip install cibuildwheel==2.1.1
5152
5253
- name: Build minimum NumPy for aarch64
5354
if: matrix.cibw_archs == 'aarch64' && steps.numpy-cache.outputs.cache-hit != 'true'
@@ -60,9 +61,17 @@ jobs:
6061
CIBW_BUILD: "cp37-* cp38-*"
6162
CIBW_ARCHS: aarch64
6263

63-
- name: Copy setup.cfg to configure wheel
64+
- name: Build wheels for CPython 3.10
6465
run: |
65-
cp setup.cfg.template setup.cfg
66+
python -m cibuildwheel --output-dir dist
67+
if: matrix.os != 'macos-10.15'
68+
env:
69+
CIBW_BUILD: "cp310-*"
70+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
71+
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
72+
CIBW_BEFORE_BUILD: pip install certifi numpy==1.21.2
73+
MPL_DISABLE_FH4: "yes"
74+
CIBW_ARCHS: ${{ matrix.cibw_archs }}
6675

6776
- name: Build wheels for CPython 3.9
6877
run: |
@@ -90,13 +99,11 @@ jobs:
9099
run: |
91100
python -m cibuildwheel --output-dir dist
92101
env:
93-
CIBW_BUILD: "pp3?-*"
102+
CIBW_BUILD: "pp37-*"
94103
CIBW_BEFORE_BUILD: pip install certifi numpy==${{ env.min-numpy-version }}
95104
CIBW_ARCHS: ${{ matrix.cibw_archs }}
96-
if: >
97-
runner.os != 'Windows' && (
98-
startsWith(github.ref, 'refs/heads/v3.3') ||
99-
startsWith(github.ref, 'refs/tags/v3.3') )
105+
PIP_USE_FEATURE: in-tree-build
106+
if: matrix.cibw_archs != 'aarch64'
100107

101108
- name: Validate that LICENSE files are included in wheels
102109
run: |

.github/workflows/clean_pr.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: PR cleanliness
2+
on: [pull_request]
3+
4+
jobs:
5+
pr_clean:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- uses: actions/checkout@v2
10+
with:
11+
fetch-depth: '0'
12+
- name: Check for added-and-deleted files
13+
run: |
14+
git fetch --quiet origin "$GITHUB_BASE_REF"
15+
base="$(git merge-base "origin/$GITHUB_BASE_REF" 'HEAD^2')"
16+
ad="$(git log "$base..HEAD^2" --pretty=tformat: --name-status --diff-filter=AD |
17+
cut --fields 2 | sort | uniq --repeated)"
18+
if [[ -n "$ad" ]]; then
19+
printf 'The following files were both added and deleted in this PR:\n%s\n' "$ad"
20+
exit 1
21+
fi
22+

.github/workflows/pr_welcome.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
3333
We strive to be a welcoming and open project. Please follow our
3434
[Code of
35-
Conduct](https://github.com/matplotlib/matplotlib/blob/master/CODE_OF_CONDUCT.md).
35+
Conduct](https://github.com/matplotlib/matplotlib/blob/main/CODE_OF_CONDUCT.md).

.github/workflows/tests.yml

Lines changed: 49 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ jobs:
4141
python-version: 3.9
4242
extra-requirements: '-r requirements/testing/extra.txt'
4343
XVFB_RUN: xvfb-run -a
44+
- os: ubuntu-20.04
45+
python-version: '3.10-dev'
46+
# Re-add this when extra dependencies have wheels.
47+
# extra-requirements: '-r requirements/testing/extra.txt'
48+
XVFB_RUN: xvfb-run -a
4449
- os: macos-latest
4550
python-version: 3.8
4651
XVFB_RUN: ""
@@ -65,6 +70,7 @@ jobs:
6570
cm-super \
6671
dvipng \
6772
ffmpeg \
73+
fonts-noto-cjk \
6874
gdb \
6975
gir1.2-gtk-3.0 \
7076
graphviz \
@@ -95,9 +101,14 @@ jobs:
95101
texlive-luatex \
96102
texlive-xetex \
97103
ttf-wqy-zenhei
104+
if [[ "${{ matrix.os }}" = ubuntu-20.04 ]]; then
105+
sudo apt install -yy libopengl0
106+
fi
98107
;;
99108
macOS)
100109
brew install ccache
110+
brew tap homebrew/cask-fonts
111+
brew install font-noto-sans-cjk-sc
101112
;;
102113
esac
103114
@@ -106,25 +117,25 @@ jobs:
106117
if: startsWith(runner.os, 'Linux')
107118
with:
108119
path: ~/.cache/pip
109-
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements/*/*.txt') }}
120+
key: ${{ matrix.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements/*/*.txt') }}
110121
restore-keys: |
111-
${{ runner.os }}-py${{ matrix.python-version }}-pip-
122+
${{ matrix.os }}-py${{ matrix.python-version }}-pip-
112123
- name: Cache pip
113124
uses: actions/cache@v2
114125
if: startsWith(runner.os, 'macOS')
115126
with:
116127
path: ~/Library/Caches/pip
117-
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements/*/*.txt') }}
128+
key: ${{ matrix.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements/*/*.txt') }}
118129
restore-keys: |
119-
${{ runner.os }}-py${{ matrix.python-version }}-pip-
130+
${{ matrix.os }}-py${{ matrix.python-version }}-pip-
120131
- name: Cache ccache
121132
uses: actions/cache@v2
122133
with:
123134
path: |
124135
~/.ccache
125-
key: ${{ runner.os }}-py${{ matrix.python-version }}-ccache-${{ hashFiles('src/*') }}
136+
key: ${{ matrix.os }}-py${{ matrix.python-version }}-ccache-${{ hashFiles('src/*') }}
126137
restore-keys: |
127-
${{ runner.os }}-py${{ matrix.python-version }}-ccache-
138+
${{ matrix.os }}-py${{ matrix.python-version }}-ccache-
128139
- name: Cache Matplotlib
129140
uses: actions/cache@v2
130141
with:
@@ -160,28 +171,40 @@ jobs:
160171
# (sometimes, the install appears to be successful but shared
161172
# libraries cannot be loaded at runtime, so an actual import is a
162173
# better check).
174+
# PyGObject, pycairo, and cariocffi do not install on OSX 10.12.
175+
python -m pip install --upgrade pycairo 'cairocffi>=0.8' PyGObject &&
176+
python -c 'import gi; gi.require_version("Gtk", "3.0"); from gi.repository import Gtk' &&
177+
echo 'PyGObject is available' ||
178+
echo 'PyGObject is not available'
179+
180+
# There are no functioning wheels available for OSX 10.12 (as of
181+
# Sept 2020) for either pyqt5 (there are only wheels for 10.13+) or
182+
# pyside2 (the latest version (5.13.2) with 10.12 wheels has a
183+
# fatal to us bug, it was fixed in 5.14.0 which has 10.13 wheels)
184+
python -mpip install --upgrade pyqt5${{ matrix.pyqt5-ver }} &&
185+
python -c 'import PyQt5.QtCore' &&
186+
echo 'PyQt5 is available' ||
187+
echo 'PyQt5 is not available'
163188
if [[ "${{ runner.os }}" != 'macOS' ]]; then
164-
# PyGObject, pycairo, and cariocffi do not install on OSX 10.12.
165-
python -m pip install --upgrade pycairo 'cairocffi>=0.8' PyGObject &&
166-
python -c 'import gi; gi.require_version("Gtk", "3.0"); from gi.repository import Gtk' &&
167-
echo 'PyGObject is available' ||
168-
echo 'PyGObject is not available'
169-
170-
# There are no functioning wheels available for OSX 10.12 (as of
171-
# Sept 2020) for either pyqt5 (there are only wheels for 10.13+) or
172-
# pyside2 (the latest version (5.13.2) with 10.12 wheels has a
173-
# fatal to us bug, it was fixed in 5.14.0 which has 10.13 wheels)
174-
python -m pip install --upgrade pyqt5${{ matrix.pyqt5-ver }} &&
175-
python -c 'import PyQt5.QtCore' &&
176-
echo 'PyQt5 is available' ||
177-
echo 'PyQt5 is not available'
178-
python -m pip install --upgrade pyside2 &&
179-
python -c 'import PySide2.QtCore' &&
180-
echo 'PySide2 is available' ||
181-
echo 'PySide2 is not available'
189+
python -mpip install --upgrade pyside2 &&
190+
python -c 'import PySide2.QtCore' &&
191+
echo 'PySide2 is available' ||
192+
echo 'PySide2 is not available'
193+
fi
194+
# Qt6 crashes on Github's ubuntu 18.04 runner.
195+
if [[ "${{ matrix.os }}" = ubuntu-20.04 ]]; then
196+
python -mpip install --upgrade pyqt6 &&
197+
python -c 'import PyQt6.QtCore' &&
198+
echo 'PyQt6 is available' ||
199+
echo 'PyQt6 is not available'
200+
python -mpip install --upgrade pyside6 &&
201+
python -c 'import PySide6.QtCore' &&
202+
echo 'PySide6 is available' ||
203+
echo 'PySide6 is not available'
182204
fi
183-
python -m pip install --upgrade \
184-
-f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-$(lsb_release -r -s) \
205+
206+
python -mpip install --upgrade \
207+
-f "https://extras.wxpython.org/wxPython4/extras/linux/gtk3/${{ matrix.os }}" \
185208
wxPython &&
186209
python -c 'import wx' &&
187210
echo 'wxPython is available' ||

0 commit comments

Comments
 (0)