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

Skip to content

Commit 22d6233

Browse files
authored
Merge pull request #3 from matplotlib/master
Sync fork
2 parents 48b6c13 + 197bb59 commit 22d6233

File tree

4,689 files changed

+597990
-393882
lines changed

Some content is hidden

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

4,689 files changed

+597990
-393882
lines changed

.appveyor.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# With infos from
2+
# http://tjelvarolsson.com/blog/how-to-continuously-test-your-python-code-on-windows-using-appveyor/
3+
# https://packaging.python.org/en/latest/appveyor/
4+
# https://github.com/rmcgibbo/python-appveyor-conda-example
5+
6+
# Backslashes in quotes need to be escaped: \ -> "\\"
7+
branches:
8+
except:
9+
- /auto-backport-.*/
10+
11+
environment:
12+
13+
global:
14+
PYTHONIOENCODING: UTF-8
15+
PYTEST_ARGS: -rawR --numprocesses=auto --timeout=300 --durations=25
16+
--cov-report= --cov=lib -m "not network"
17+
18+
matrix:
19+
# theoretically the CONDA_INSTALL_LOCN could be only two: one for 32bit,
20+
# one for 64bit because we construct envs anyway. But using one for the
21+
# right python version is hopefully making it fast due to package caching.
22+
- PYTHON_VERSION: "3.5"
23+
CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64"
24+
TEST_ALL: "no"
25+
- PYTHON_VERSION: "3.6"
26+
CONDA_INSTALL_LOCN: "C:\\Miniconda36-x64"
27+
TEST_ALL: "no"
28+
29+
# We always use a 64-bit machine, but can build x86 distributions
30+
# with the PYTHON_ARCH variable
31+
platform:
32+
- x64
33+
34+
# all our python builds have to happen in tests_script...
35+
build: false
36+
37+
cache:
38+
- '%LOCALAPPDATA%\pip\Cache'
39+
- '%USERPROFILE%\.cache\matplotlib'
40+
41+
init:
42+
- echo %PYTHON_VERSION% %CONDA_INSTALL_LOCN%
43+
44+
install:
45+
- set PATH=%CONDA_INSTALL_LOCN%;%CONDA_INSTALL_LOCN%\scripts;%PATH%;
46+
- set PYTHONUNBUFFERED=1
47+
# for msinttypes and newer stuff
48+
- conda config --set always_yes true
49+
- conda update --all
50+
- conda config --set show_channel_urls yes
51+
- conda config --prepend channels conda-forge
52+
# this is now the downloaded conda...
53+
- conda info -a
54+
55+
# For building, use a new environment which only includes the requirements for mpl
56+
# same things as the requirements in ci/conda_recipe/meta.yaml
57+
# if conda-forge gets a new pyqt, it might be nice to install it as well to have more backends
58+
# https://github.com/conda-forge/conda-forge.github.io/issues/157#issuecomment-223536381
59+
#
60+
- conda create -q -n test-environment python=%PYTHON_VERSION%
61+
msinttypes freetype=2.6 "libpng>=1.6.21,<1.7" zlib=1.2 tk=8.5
62+
pip setuptools numpy pandas sphinx tornado
63+
- activate test-environment
64+
- echo %PYTHON_VERSION% %TARGET_ARCH%
65+
# pytest-cov>=2.3.1 due to https://github.com/pytest-dev/pytest-cov/issues/124
66+
- pip install -q "pytest>=3.4" "pytest-cov>=2.3.1" pytest-rerunfailures pytest-timeout pytest-xdist
67+
68+
# Apply patch to `subprocess` on Python versions > 2 and < 3.6.3
69+
# https://github.com/matplotlib/matplotlib/issues/9176
70+
- python -c "import sys; sys.exit(not (3,) < sys.version_info < (3,6,3))" && (
71+
curl -sL https://github.com/python/cpython/pull/1224.patch |
72+
patch -fsup 1 -d %CONDA_PREFIX% ) || cmd /c "exit /b 0"
73+
74+
# Let the install prefer the static builds of the libs
75+
- set LIBRARY_LIB=%CONDA_PREFIX%\Library\lib
76+
- mkdir lib || cmd /c "exit /b 0"
77+
- copy /y %LIBRARY_LIB%\zlibstatic.lib lib\z.lib
78+
- copy /y %LIBRARY_LIB%\libpng_static.lib lib\png.lib
79+
# These z.lib / png.lib are not static versions but files which end up as
80+
# dependencies to the dll file. This is fine for the conda build, but not here
81+
# and for the wheels
82+
- del %LIBRARY_LIB%\png.lib
83+
- del %LIBRARY_LIB%\z.lib
84+
- set MPLBASEDIRLIST=%CONDA_PREFIX%\Library\;.
85+
# enables the local freetype build
86+
- copy ci\travis\setup.cfg .
87+
# Show the installed packages + versions
88+
- conda list
89+
90+
test_script:
91+
# Now build the thing..
92+
- pip install -ve .
93+
# these should show no z, png, or freetype dll...
94+
- set "DUMPBIN=%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe"
95+
- '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\ft2font*.pyd | findstr freetype.*.dll && exit /b 1 || exit /b 0'
96+
- '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\_png*.pyd | findstr z.*.dll && exit /b 1 || exit /b 0'
97+
- '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\_png*.pyd | findstr png.*.dll && exit /b 1 || exit /b 0'
98+
99+
# this are optional dependencies so that we don't skip so many tests...
100+
- if x%TEST_ALL% == xyes conda install -q ffmpeg inkscape miktex pillow
101+
# missing packages on conda-forge for avconv imagemagick
102+
# This install sometimes failed randomly :-(
103+
#- choco install imagemagick
104+
105+
# Test import of tkagg backend
106+
- python -c "import matplotlib as m; m.use('tkagg'); import matplotlib.pyplot as plt; print(plt.get_backend())"
107+
# tests
108+
- echo The following args are passed to pytest %PYTEST_ARGS%
109+
- python tests.py %PYTEST_ARGS%
110+
111+
after_test:
112+
# After the tests were a success, build wheels with the static libs
113+
# Hide the output, the copied files really clutter the build log...
114+
- 'python setup.py bdist_wheel > NUL:'
115+
- dir dist\
116+
- echo finished...
117+
118+
artifacts:
119+
- path: dist\*
120+
name: packages
121+
122+
- path: result_images\*
123+
name: result_images
124+
type: zip
125+
126+
on_finish:
127+
- pip install codecov
128+
- codecov -e PYTHON_VERSION PLATFORM
129+
130+
on_failure:
131+
# Generate a html for visual tests
132+
- python tools/visualize_tests.py --no-browser
133+
- echo zipping images after a failure...
134+
- 7z a result_images.zip result_images\ | grep -v "Compressing"
135+
- appveyor PushArtifact result_images.zip
136+
137+
matrix:
138+
fast_finish: true

.circleci/config.yml

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# Circle CI configuration file
2+
# https://circleci.com/docs/
3+
4+
version: 2
5+
6+
7+
###########################################
8+
# Define some common steps as YAML anchors.
9+
#
10+
11+
apt-run: &apt-install
12+
name: Install apt packages
13+
command: |
14+
sudo apt-get -qq update
15+
sudo apt-get install -y \
16+
inkscape \
17+
libav-tools \
18+
dvipng \
19+
pgf \
20+
lmodern \
21+
cm-super \
22+
texlive-latex-base \
23+
texlive-latex-extra \
24+
texlive-fonts-recommended \
25+
texlive-latex-recommended \
26+
texlive-xetex \
27+
graphviz \
28+
libgeos-dev \
29+
otf-freefont
30+
31+
fonts-run: &fonts-install
32+
name: Install custom fonts
33+
# We manually install Humor-Sans using the package from Ubuntu 14.10.
34+
# Unfortunately humor sans is not available in the Ubuntu version used by
35+
# CircleCI but we can manually install the deb from a later version since
36+
# it is basically just a .ttf file.
37+
command: |
38+
mkdir -p ~/.local/share/fonts
39+
wget -nc https://github.com/google/fonts/blob/master/ofl/felipa/Felipa-Regular.ttf?raw=true -O ~/.local/share/fonts/Felipa-Regular.ttf || true
40+
if [ ! -f ~/.local/share/fonts/Humor-Sans.ttf ]; then
41+
wget https://mirrors.kernel.org/ubuntu/pool/universe/f/fonts-humor-sans/fonts-humor-sans_1.0-1_all.deb
42+
mkdir tmp
43+
dpkg -x fonts-humor-sans_1.0-1_all.deb tmp
44+
cp tmp/usr/share/fonts/truetype/humor-sans/Humor-Sans.ttf ~/.local/share/fonts
45+
rm -rf tmp
46+
else
47+
echo "Not downloading Humor-Sans; file already exists."
48+
fi
49+
fc-cache -f -v
50+
51+
pip-run: &pip-install
52+
# Upgrade pip and setuptools and wheel to get as clean an install as possible
53+
name: Upgrade pip, setuptools, wheel
54+
command: |
55+
pip install --upgrade --user pip
56+
pip install --upgrade --user wheel
57+
pip install --upgrade --user setuptools
58+
59+
deps-run: &deps-install
60+
name: Install Python dependencies
61+
command: |
62+
pip install --user numpy${NUMPY_VERSION} codecov coverage
63+
pip install --user -r doc-requirements.txt
64+
65+
mpl-run: &mpl-install
66+
name: Install Matplotlib
67+
command: pip install --user -ve .
68+
69+
doc-run: &doc-build
70+
name: Build documentation
71+
command: make html
72+
working_directory: doc
73+
74+
doc-bundle-run: &doc-bundle
75+
name: Bundle sphinx-gallery documentation artifacts
76+
command: tar cf doc/build/sphinx-gallery-files.tar.gz doc/api/_as_gen doc/gallery doc/tutorials
77+
when: always
78+
79+
80+
##########################################
81+
# Here is where the real jobs are defined.
82+
#
83+
84+
jobs:
85+
docs-python36:
86+
docker:
87+
- image: circleci/python:3.6
88+
steps:
89+
- checkout
90+
91+
- run: *apt-install
92+
- run: *fonts-install
93+
- run: *pip-install
94+
95+
- run: *deps-install
96+
- run: *mpl-install
97+
98+
- run: *doc-build
99+
100+
- run: *doc-bundle
101+
- store_artifacts:
102+
path: doc/build/sphinx-gallery-files.tar.gz
103+
104+
- store_artifacts:
105+
path: doc/build/html
106+
107+
- run:
108+
name: "Built documentation is available at:"
109+
command: echo "${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/doc/build/html/index.html"
110+
111+
- add_ssh_keys:
112+
fingerprints:
113+
- "78:13:59:08:61:a9:e5:09:af:df:3a:d8:89:c2:84:c0"
114+
- deploy:
115+
name: "Deploy new docs"
116+
command: ./.circleci/deploy-docs.sh
117+
118+
docs-python35:
119+
docker:
120+
- image: circleci/python:3.5
121+
steps:
122+
- checkout
123+
124+
- run: *apt-install
125+
- run: *fonts-install
126+
- run: *pip-install
127+
128+
- run:
129+
<<: *deps-install
130+
environment:
131+
NUMPY_VERSION: "==1.10.0"
132+
- run: *mpl-install
133+
134+
- run: *doc-build
135+
136+
# We don't build the LaTeX docs here, so linkchecker will complain
137+
- run: touch doc/build/html/Matplotlib.pdf
138+
139+
- run: *doc-bundle
140+
- store_artifacts:
141+
path: doc/build/sphinx-gallery-files.tar.gz
142+
143+
- store_artifacts:
144+
path: doc/build/html
145+
146+
- run:
147+
name: "Built documentation is available at:"
148+
command: echo "${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/doc/build/html/index.html"
149+
150+
151+
#########################################
152+
# Defining workflows gets us parallelism.
153+
#
154+
155+
workflows:
156+
version: 2
157+
build:
158+
jobs:
159+
- docs-python35
160+
- docs-python36

.circleci/deploy-docs.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [ "$CIRCLE_PROJECT_USERNAME" != "matplotlib" -o "$CIRCLE_BRANCH" != "master" -o "$CIRCLE_PULL_REQUEST" != "" ]; then
6+
echo "Not uploading docs from non-master branch or non-Matplotlib org."
7+
exit
8+
fi
9+
10+
git clone [email protected]:matplotlib/devdocs.git
11+
12+
cd devdocs
13+
14+
git checkout --orphan gh-pages || true
15+
git reset --hard first_commit
16+
17+
git rm -rf .
18+
cp -R ../doc/build/html/. .
19+
touch .nojekyll
20+
21+
git config user.email "MatplotlibCircleBot@nomail"
22+
git config user.name "MatplotlibCircleBot"
23+
git config push.default simple
24+
25+
git add .
26+
git commit -m "Docs build of $CIRCLE_SHA1"
27+
28+
git push --set-upstream origin gh-pages --force

.coveragerc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[run]
2+
branch = true
3+
source =
4+
matplotlib
5+
mpl_toolkits
6+
omit = matplotlib/_version.py
7+
8+
[report]
9+
exclude_lines =
10+
raise NotImplemented
11+
def __str__
12+
def __repr__
13+
if __name__ == .__main__.:

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
* text=auto
2+
*.svg binary
3+
*.svg linguist-language=true
4+
lib/matplotlib/_version.py export-subst
File renamed without changes.

.github/ISSUE_TEMPLATE.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!--To help us understand and resolve your issue, please fill out the form to the best of your ability.-->
2+
<!--You can feel free to delete the sections that do not apply.-->
3+
4+
### Bug report
5+
6+
**Bug summary**
7+
8+
<!--A short 1-2 sentences that succinctly describes the bug-->
9+
10+
**Code for reproduction**
11+
12+
<!--A minimum code snippet required to reproduce the bug, also minimizing the number of dependencies required-->
13+
14+
```python
15+
# Paste your code here
16+
#
17+
#
18+
```
19+
20+
**Actual outcome**
21+
22+
<!--The output produced by the above code, which may be a screenshot, console output, etc.-->
23+
24+
```
25+
# If applicable, paste the console output here
26+
#
27+
#
28+
```
29+
30+
**Expected outcome**
31+
32+
<!--A description of the expected outcome from the code snippet-->
33+
<!--If this used to work in an earlier version of Matplotlib, please note the version it used to work on-->
34+
35+
**Matplotlib version**
36+
<!--Please specify your platform and versions of the relevant libraries you are using:-->
37+
* Operating system:
38+
* Matplotlib version:
39+
* Matplotlib backend (`print(matplotlib.get_backend())`):
40+
* Python version:
41+
* Jupyter version (if applicable):
42+
* Other libraries:
43+
44+
<!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda-->
45+
<!--If you installed from conda, please specify which channel you used if not the default-->
46+

0 commit comments

Comments
 (0)