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

Skip to content

Commit 8e796b3

Browse files
authored
Merge pull request #20 from matplotlib/master
merge
2 parents db61667 + 239276e commit 8e796b3

File tree

567 files changed

+16468
-8448
lines changed

Some content is hidden

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

567 files changed

+16468
-8448
lines changed

appveyor.yml renamed to .appveyor.yml

Lines changed: 57 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ environment:
1111
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
1212
# /E:ON and /V:ON options are not enabled in the batch script intepreter
1313
# See: http://stackoverflow.com/a/13751649/163740
14-
CMD_IN_ENV: "cmd /E:ON /V:ON /C obvci_appveyor_python_build_env.cmd"
14+
CMD_IN_ENV: cmd /E:ON /V:ON /C obvci_appveyor_python_build_env.cmd
1515
# Workaround for https://github.com/conda/conda-build/issues/636
16-
PYTHONIOENCODING: "UTF-8"
17-
TEST_ARGS: --no-pep8
18-
PYTEST_ARGS: -ra --timeout=300 --durations=25 #--cov-report= --cov=lib #-n %NUMBER_OF_PROCESSORS%
19-
USE_PYTEST: no
20-
#PYTHONHASHSEED: 0 # Workaround for pytest-xdist flaky colletion order
21-
# # https://github.com/pytest-dev/pytest/issues/920
22-
# # https://github.com/pytest-dev/pytest/issues/1075
16+
PYTHONIOENCODING: UTF-8
17+
PYTEST_ARGS: -ra --timeout=300 --durations=25 -n %NUMBER_OF_PROCESSORS% --cov-report= --cov=lib -m "not network"
18+
PYTHONHASHSEED: 0 # Workaround for pytest-xdist flaky collection order
19+
# https://github.com/pytest-dev/pytest/issues/920
20+
# https://github.com/pytest-dev/pytest/issues/1075
2321

2422
matrix:
2523
# for testing purpose: numpy 1.8 on py2.7, for the rest use 1.10/latest
@@ -32,25 +30,12 @@ environment:
3230
PYTHON_VERSION: "2.7"
3331
TEST_ALL: "no"
3432
CONDA_INSTALL_LOCN: "C:\\Miniconda-x64"
35-
- TARGET_ARCH: "x64"
36-
CONDA_PY: "34"
37-
CONDA_NPY: "110"
38-
PYTHON_VERSION: "3.4"
39-
TEST_ALL: "no"
40-
CONDA_INSTALL_LOCN: "C:\\Miniconda3-x64"
4133
- TARGET_ARCH: "x64"
4234
CONDA_PY: "35"
4335
CONDA_NPY: "110"
4436
PYTHON_VERSION: "3.5"
4537
TEST_ALL: "no"
4638
CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64"
47-
- TARGET_ARCH: "x64"
48-
CONDA_PY: "35"
49-
CONDA_NPY: "110"
50-
PYTHON_VERSION: "3.5"
51-
TEST_ALL: "no"
52-
CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64"
53-
USE_PYTEST: yes
5439
- TARGET_ARCH: "x86"
5540
CONDA_PY: "27"
5641
CONDA_NPY: "18"
@@ -70,26 +55,32 @@ platform:
7055
# all our python builds have to happen in tests_script...
7156
build: false
7257

58+
cache:
59+
- '%LOCALAPPDATA%\pip\Cache'
60+
- '%USERPROFILE%\.cache\matplotlib'
61+
7362
init:
74-
- cmd: "ECHO %PYTHON_VERSION% PYTEST=%USE_PYTEST% %CONDA_INSTALL_LOCN%"
63+
- echo %PYTHON_VERSION% %CONDA_INSTALL_LOCN%
7564

7665
install:
77-
- cmd: set PATH=%CONDA_INSTALL_LOCN%;%CONDA_INSTALL_LOCN%\scripts;%PATH%;
78-
- cmd: set PYTHONUNBUFFERED=1
66+
- set PATH=%CONDA_INSTALL_LOCN%;%CONDA_INSTALL_LOCN%\scripts;%PATH%;
67+
- set PYTHONUNBUFFERED=1
7968
# for obvci_appveyor_python_build_env.cmd
80-
- cmd: conda install -c pelson/channel/development --yes --quiet obvious-ci
69+
- conda install -c pelson/channel/development --yes --quiet obvious-ci
8170
# for msinttypes and newer stuff
82-
- cmd: conda config --add channels conda-forge
83-
- cmd: conda config --set show_channel_urls yes
84-
- cmd: conda config --set always_yes true
71+
# conda-forge may serve outdated versions of certain packages (e.g. conda
72+
# itself), so append it to the end of the list.
73+
- conda config --append channels conda-forge
74+
- conda config --set show_channel_urls yes
75+
- conda config --set always_yes true
8576
# For building conda packages
86-
- cmd: conda install --yes conda-build jinja2 anaconda-client
77+
- conda install --yes conda-build jinja2 anaconda-client
8778
# this is now the downloaded conda...
8879
- conda info -a
8980

9081
# Fix the appveyor build environment to work with conda build
9182
# workaround for missing vcvars64.bat in py34 64bit
92-
- cmd: copy ci\appveyor\vcvars64.bat "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64"
83+
- copy ci\appveyor\vcvars64.bat "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64"
9384

9485
# For building, use a new environment which only includes the requirements for mpl
9586
# same things as the requirements in ci/conda_recipe/meta.yaml
@@ -98,18 +89,18 @@ install:
9889
- conda create -q -n test-environment python=%PYTHON_VERSION%
9990
pip setuptools numpy python-dateutil freetype=2.6 msinttypes "tk=8.5"
10091
pyparsing pytz tornado "libpng>=1.6.21,<1.7" "zlib=1.2" "cycler>=0.10"
101-
nose mock sphinx
92+
mock sphinx
10293
- activate test-environment
103-
- cmd: echo %PYTHON_VERSION% %TARGET_ARCH%
104-
- cmd: IF %PYTHON_VERSION% == 2.7 conda install -q functools32
94+
- echo %PYTHON_VERSION% %TARGET_ARCH%
95+
- if %PYTHON_VERSION% == 2.7 conda install -q backports.functools_lru_cache
10596
# pytest-cov>=2.3.1 due to https://github.com/pytest-dev/pytest-cov/issues/124
106-
- if x%USE_PYTEST% == xyes conda install -q pytest "pytest-cov>=2.3.1" pytest-timeout #pytest-xdist
97+
- conda install -q pytest "pytest-cov>=2.3.1" pytest-timeout pytest-xdist
10798

10899
# Let the install prefer the static builds of the libs
109100
- set LIBRARY_LIB=%CONDA_PREFIX%\Library\lib
110-
- cmd: 'mkdir lib || cmd /c "exit /b 0"'
111-
- copy /Y %LIBRARY_LIB%\zlibstatic.lib lib\z.lib
112-
- copy /Y %LIBRARY_LIB%\libpng_static.lib lib\png.lib
101+
- mkdir lib || cmd /c "exit /b 0"
102+
- copy /y %LIBRARY_LIB%\zlibstatic.lib lib\z.lib
103+
- copy /y %LIBRARY_LIB%\libpng_static.lib lib\png.lib
113104
# These z.lib / png.lib are not static versions but files which end up as
114105
# dependencies to the dll file. This is fine for the conda build, but not here
115106
# and for the wheels
@@ -123,56 +114,54 @@ install:
123114

124115
test_script:
125116
# Now build the thing..
126-
- '%CMD_IN_ENV% python setup.py develop'
117+
- '%CMD_IN_ENV% pip install --no-deps -ve .'
127118
# these should show no z, png, or freetype dll...
128119
- set "DUMPBIN=%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe"
129-
#- cmd: '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\_png*.pyd'
130-
#- cmd: '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\ft2font*.pyd'
131-
- cmd: '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\ft2font*.pyd | findstr freetype.*.dll && exit /b 1 || exit /b 0'
132-
- cmd: '"%DUMPBIN%" /DEPENDENTS lib\\matplotlib\\_png*.pyd | findstr z.*.dll && exit /b 1 || exit /b 0'
133-
- cmd: '"%DUMPBIN%" /DEPENDENTS lib\\matplotlib\\_png*.pyd | findstr png.*.dll && exit /b 1 || exit /b 0'
120+
- '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\ft2font*.pyd | findstr freetype.*.dll && exit /b 1 || exit /b 0'
121+
- '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\_png*.pyd | findstr z.*.dll && exit /b 1 || exit /b 0'
122+
- '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\_png*.pyd | findstr png.*.dll && exit /b 1 || exit /b 0'
134123

135124
# this are optional dependencies so that we don't skip so many tests...
136-
- cmd: if x%TEST_ALL% == xyes; conda install -q pillow miktex inkscape
137-
# missing packages on conda-forge for ffmpeg avconv mencoder imagemagick
138-
- cmd: if x%TEST_ALL% == xyes; conda install -q -c menpo ffmpeg # a repackaged version
125+
- if x%TEST_ALL% == xyes conda install -q ffmpeg inkscape miktex pillow
126+
# missing packages on conda-forge for avconv mencoder imagemagick
139127
# This install sometimes failed randomly :-(
140-
#- cmd: choco install imagemagick
128+
#- choco install imagemagick
141129

142130
# Test import of tkagg backend
143131
- python -c "import matplotlib as m; m.use('tkagg'); import matplotlib.pyplot as plt; print(plt.get_backend())"
144132
# tests
145-
- if x%USE_PYTEST% == xyes echo The following args are passed to pytest %PYTEST_ARGS%
146-
- if x%USE_PYTEST% == xyes py.test %PYTEST_ARGS% %TEST_ARGS%
147-
- if x%USE_PYTEST% == xno python tests.py %TEST_ARGS%
133+
- echo The following args are passed to pytest %PYTEST_ARGS%
134+
- python tests.py %PYTEST_ARGS%
148135
# Generate a html for visual tests
149-
- python visual_tests.py
136+
- python tools/visualize_tests.py --no-browser
137+
- pip install codecov
138+
- codecov -e PYTHON_VERSION PLATFORM
150139

151140
after_test:
152141
# After the tests were a success, build packages (wheels and conda)
153142

154143
# Build the wheel with the static libs
155144
# Hide the output, the copied files really clutter the build log...
156-
- cmd: '%CMD_IN_ENV% python setup.py bdist_wheel > NUL:'
145+
- '%CMD_IN_ENV% python setup.py bdist_wheel > NUL:'
157146

158147
# And now the conda build after a cleanup...
159148
# cleanup build files so that they don't pollute the conda build but keep the wheel in dist...
160-
- cmd: git clean -d -x -f -e dist/
149+
- git clean -xdfq -e dist/
161150
# cleanup the environment so that the test-environment does not leak into the conda build...
162-
- cmd: set MPLBASEDIRLIST=
163-
- cmd: set LIBRARY_LIB=
164-
- cmd: deactivate
165-
- cmd: path
166-
- cmd: where python
167-
- cmd: '%CMD_IN_ENV% conda config --get channels'
168-
- cmd: '%CMD_IN_ENV% conda build -q .\ci\conda_recipe'
151+
- set MPLBASEDIRLIST=
152+
- set LIBRARY_LIB=
153+
- deactivate
154+
- path
155+
- where python
156+
- '%CMD_IN_ENV% conda config --get channels'
157+
- '%CMD_IN_ENV% conda build -q .\ci\conda_recipe'
169158

170159
# Move the conda package into the dist directory, to register it
171160
# as an "artifact" for Appveyor.
172-
- cmd: 'copy /Y %CONDA_INSTALL_LOCN%\conda-bld\win-32\*.bz2 dist || cmd /c "exit /b 0"'
173-
- cmd: 'copy /Y %CONDA_INSTALL_LOCN%\conda-bld\win-64\*.bz2 dist || cmd /c "exit /b 0"'
174-
- cmd: dir dist\
175-
- cmd: echo finished...
161+
- copy /y %CONDA_INSTALL_LOCN%\conda-bld\win-32\*.bz2 dist || cmd /c "exit /b 0"
162+
- copy /y %CONDA_INSTALL_LOCN%\conda-bld\win-64\*.bz2 dist || cmd /c "exit /b 0"
163+
- dir dist\
164+
- echo finished...
176165

177166
artifacts:
178167
- path: dist\*
@@ -182,10 +171,12 @@ artifacts:
182171
name: result_images
183172
type: zip
184173

174+
on_finish:
175+
185176
on_failure:
186-
- python visual_tests.py
177+
- python tools/visualize_tests.py --no-browser
187178
- echo zipping images after a failure...
188-
- 7z a result_images.zip result_images\ |grep -v "Compressing"
179+
- 7z a result_images.zip result_images\ | grep -v "Compressing"
189180
- appveyor PushArtifact result_images.zip
190181

191182
matrix:

.coveragerc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
[run]
2-
source=
2+
branch = true
3+
source =
34
matplotlib
45
mpl_toolkits
5-
[report]
6-
omit =
7-
lib/matplotlib/tests/*
8-
lib/matplotlib/testing/*
9-
lib/mpl_toolkits/tests/*
6+
omit = matplotlib/_version.py
107

8+
[report]
119
exclude_lines =
1210
raise NotImplemented
1311
def __str__

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
build
3333
# sphinx build directory
3434
doc/_build
35+
doc/gallery
3536
# setup.py dist directory
3637
dist
3738
# Egg metadata
@@ -57,12 +58,13 @@ lib/matplotlib/mpl-data/matplotlibrc
5758

5859
# Documentation generated files #
5960
#################################
61+
doc/api/_as_gen
6062
doc/examples
61-
doc/_templates/gallery.html
63+
# autogenerated by sphinx-gallery
64+
doc/modules
65+
doc/pyplots/tex_demo.png
6266
doc/users/installing.rst
6367
doc/_static/matplotlibrc
64-
doc/pyplots/tex_demo.png
65-
doc/api/_as_gen
6668
lib/dateutil
6769
examples/*/*.pdf
6870
examples/*/*.png

.travis.yml

Lines changed: 19 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -43,33 +43,31 @@ env:
4343
- OPENBLAS_NUM_THREADS=1
4444
- PANDAS=
4545
- NPROC=2
46-
- TEST_ARGS=--no-pep8
47-
- NOSE_ARGS="-j $NPROC"
46+
- INSTALL_PEP8=
47+
- RUN_PEP8=
4848
- PYTEST_ARGS="-ra --maxfail=1 --timeout=300 --durations=25 --cov-report= --cov=lib -n $NPROC"
4949
- PYTHON_ARGS=
5050
- DELETE_FONT_CACHE=
51-
- USE_PYTEST=false
5251

5352
matrix:
5453
include:
5554
- python: 2.7
56-
env: MOCK=mock NUMPY=numpy==1.7.1
55+
env: MOCK=mock NUMPY=numpy==1.7.1 PANDAS=pandas
56+
- python: 2.7
57+
env: BUILD_DOCS=true
5758
- python: 3.4
5859
env: PYTHON_ARGS=-OO
59-
- python: 3.5
60-
env: PANDAS=pandas NOSE_ARGS=--with-coverage DELETE_FONT_CACHE=1
6160
- python: 3.5
6261
env: BUILD_DOCS=true
63-
- python: 3.5
64-
env: USE_PYTEST=true PANDAS=pandas DELETE_FONT_CACHE=1 TEST_ARGS=
6562
- python: 3.6
66-
env: USE_PYTEST=true DELETE_FONT_CACHE=1 TEST_ARGS=
63+
env: DELETE_FONT_CACHE=1 INSTALL_PEP8=pytest-pep8 RUN_PEP8=--pep8
6764
- python: "nightly"
6865
env: PRE=--pre
6966
- os: osx
7067
osx_image: xcode7.3
7168
language: generic # https://github.com/travis-ci/travis-ci/issues/2312
72-
env: MOCK=mock NOSE_ARGS=
69+
env: MOCK=mock
70+
only: master
7371
cache:
7472
# As for now travis caches only "$HOME/.cache/pip"
7573
# https://docs.travis-ci.com/user/caching/#pip-cache
@@ -104,23 +102,23 @@ before_install:
104102
fi
105103
106104
install:
105+
# Upgrade pip and setuptools. Mock has issues with the default version of
106+
# setuptools
107107
- |
108108
# Setup environment
109109
ccache -s
110+
git describe
110111
# Upgrade pip and setuptools and wheel to get as clean an install as possible
111112
pip install --upgrade pip
112113
pip install --upgrade wheel
113114
pip install --upgrade setuptools
114115
- |
115116
# Install dependencies from pypi
116-
pip install $PRE python-dateutil $NUMPY pyparsing!=2.1.6 $PANDAS pep8 cycler coveralls coverage $MOCK
117+
pip install $PRE python-dateutil $NUMPY pyparsing!=2.1.6 $PANDAS cycler codecov coverage $MOCK
117118
pip install $PRE -r doc-requirements.txt
118119
119-
# Install nose from a build which has partial
120-
# support for python36 and suport for coverage output suppressing
121-
pip install git+https://github.com/jenshnielsen/nose.git@matplotlibnose
122120
# pytest-cov>=2.3.1 due to https://github.com/pytest-dev/pytest-cov/issues/124
123-
pip install $PRE pytest 'pytest-cov>=2.3.1' pytest-timeout pytest-xdist pytest-faulthandler
121+
pip install $PRE pytest 'pytest-cov>=2.3.1' pytest-timeout pytest-xdist pytest-faulthandler $INSTALL_PEP8
124122
125123
# We manually install humor sans using the package from Ubuntu 14.10. Unfortunatly humor sans is not
126124
# availible in the Ubuntu version used by Travis but we can manually install the deb from a later
@@ -143,48 +141,9 @@ install:
143141
# Install matplotlib
144142
pip install -ve .
145143
146-
script:
147-
# The number of processes is hardcoded, because using too many causes the
148-
# Travis VM to run out of memory (since so many copies of inkscape and
149-
# ghostscript are running at the same time).
150-
- |
151-
echo Testing import of tkagg backend
152-
MPLBACKEND="tkagg" python -c 'import matplotlib.pyplot as plt; print(plt.get_backend())'
153-
if [[ $BUILD_DOCS == false ]]; then
154-
if [[ $DELETE_FONT_CACHE == 1 ]]; then
155-
rm -rf ~/.cache/matplotlib
156-
fi
157-
export MPL_REPO_DIR=$PWD # needed for pep8-conformance test of the examples
158-
if [[ $USE_PYTEST == false ]]; then
159-
echo The following args are passed to nose $NOSE_ARGS
160-
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
161-
python tests.py $NOSE_ARGS $TEST_ARGS
162-
else
163-
gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $NOSE_ARGS $TEST_ARGS
164-
fi
165-
else
166-
# Workaround for pytest-xdist flaky colletion order
167-
# https://github.com/pytest-dev/pytest/issues/920
168-
# https://github.com/pytest-dev/pytest/issues/1075
169-
export PYTHONHASHSEED=$(shuf -i 1-4294967295 -n 1)
170-
echo PYTHONHASHSEED=$PYTHONHASHSEED
144+
script: source ci/travis/test_script.sh
171145

172-
echo The following args are passed to pytest $PYTEST_ARGS
173-
py.test $PYTEST_ARGS $TEST_ARGS
174-
fi
175-
else
176-
cd doc
177-
python make.py html -n 2
178-
# We don't build the LaTeX docs here, so linkchecker will complain
179-
touch build/html/Matplotlib.pdf
180-
# Linkchecker only works with python 2.7 for the time being
181-
deactivate
182-
source ~/virtualenv/python2.7/bin/activate
183-
pip install pip --upgrade
184-
# linkchecker is currently broken with requests 2.10.0 so force an earlier version
185-
pip install $PRE requests==2.9.2 linkchecker
186-
linkchecker build/html/index.html
187-
fi
146+
before_cache:
188147
- rm -rf $HOME/.cache/matplotlib/tex.cache
189148
- rm -rf $HOME/.cache/matplotlib/test_cache
190149

@@ -201,6 +160,10 @@ after_failure:
201160
fi
202161
203162
after_success:
163+
- |
164+
if [[ $BUILD_DOCS == false ]]; then
165+
codecov -e TRAVIS_PYTHON_VERSION
166+
fi
204167
- |
205168
if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_REPO_SLUG == 'matplotlib/matplotlib' && $BUILD_DOCS == true && $TRAVIS_BRANCH == 'master' ]]; then
206169
cd $TRAVIS_BUILD_DIR
@@ -225,7 +188,3 @@ after_success:
225188
else
226189
echo "Will only deploy docs build from matplotlib master branch"
227190
fi
228-
if [[ $NOSE_ARGS =~ "--with-coverage" || $USE_PYTEST == true ]]; then
229-
coveralls
230-
bash <(curl -s https://codecov.io/bash)
231-
fi

0 commit comments

Comments
 (0)