Skip to content

Commit 6f23d0f

Browse files
committed
Merge branch 'master' of github.com:matplotlib/matplotlib into category
2 parents 89bd77d + 94f2fb8 commit 6f23d0f

File tree

17 files changed

+127
-195
lines changed

17 files changed

+127
-195
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Adrien F. Vincent <vincent.adrien@gmail.com>
12
Andrew Dawson <ajdawson@acm.org> <dawson@atm.ox.ac.uk>
23
anykraus <kraus@mpip-mainz.mpg.de> <anykraus@users.noreply.github.com>
34
Ariel Hernán Curiale <curiale@gmail.com>

README.win.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ without fiddling with environment variables.
1919

2020
``` sh
2121
# create a new environment with the required packages
22-
conda create -n "matplotlib_build" python=3.4 numpy python-dateutil pyparsing pytz tornado pyqt cycler tk libpng zlib freetype
22+
conda create -n "matplotlib_build" python=3.4 numpy python-dateutil pyparsing pytz tornado "cycler>=0.10" tk libpng zlib freetype
2323
activate matplotlib_build
24+
# if you want a qt backend, you also have to install pyqt (be aware that pyqt doesn't mix well if
25+
# you have created the environment with conda-forge already activated...)
26+
conda install pyqt
2427
# this package is only available in the conda-forge channel
2528
conda install -c conda-forge msinttypes
2629
# for python 2.7

appveyor.yml

Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,36 @@ environment:
1717

1818
matrix:
1919
# for testing purpose: numpy 1.8 on py2.7, for the rest use 1.10/latest
20+
# theoretically the CONDA_INSTALL_LOCN could be only two: one for 32bit, one for 64bit
21+
# but using one for the right python version is hopefully making it fast due to package caching.
2022
- TARGET_ARCH: "x86"
2123
CONDA_PY: "27"
2224
CONDA_NPY: "18"
2325
PYTHON_VERSION: "2.7"
26+
# this variable only influence pdf/svg tests, png tests are run on any platform
27+
# only once, because it basically triples the testing times
28+
# pick the one which seems to make the most problems
29+
TEST_ALL_IMAGES: "yes"
2430
CONDA_INSTALL_LOCN: "C:\\Miniconda"
2531
- TARGET_ARCH: "x64"
2632
CONDA_PY: "27"
2733
CONDA_NPY: "18"
2834
PYTHON_VERSION: "2.7"
35+
TEST_ALL_IMAGES: "no"
2936
CONDA_INSTALL_LOCN: "C:\\Miniconda-x64"
3037
- TARGET_ARCH: "x64"
3138
CONDA_PY: "34"
3239
CONDA_NPY: "110"
3340
PYTHON_VERSION: "3.4"
41+
TEST_ALL_IMAGES: "no"
3442
CONDA_INSTALL_LOCN: "C:\\Miniconda3-x64"
3543
- TARGET_ARCH: "x64"
3644
CONDA_PY: "35"
3745
CONDA_NPY: "110"
3846
PYTHON_VERSION: "3.5"
47+
TEST_ALL_IMAGES: "no"
3948
CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64"
4049

41-
4250
# We always use a 64-bit machine, but can build x86 distributions
4351
# with the PYTHON_ARCH variable (which is used by CMD_IN_ENV).
4452
platform:
@@ -53,11 +61,14 @@ init:
5361
install:
5462
- cmd: set PATH=%CONDA_INSTALL_LOCN%;%CONDA_INSTALL_LOCN%\scripts;%PATH%;
5563
- cmd: set PYTHONUNBUFFERED=1
56-
- cmd: conda install -c http://conda.anaconda.org/pelson/channel/development --yes --quiet obvious-ci
57-
- cmd: obvci_install_conda_build_tools.py
58-
- cmd: conda config --set show_channel_urls yes
59-
# for msinttypes
64+
# for obvci_appveyor_python_build_env.cmd
65+
- cmd: conda install -c pelson/channel/development --yes --quiet obvious-ci
66+
# for msinttypes and newer stuff
6067
- cmd: conda config --add channels conda-forge
68+
- cmd: conda config --set show_channel_urls yes
69+
- cmd: conda config --set always_yes true
70+
# For building conda packages
71+
- cmd: conda install --yes conda-build jinja2 anaconda-client
6172
# this is now the downloaded conda...
6273
- conda info -a
6374

@@ -68,17 +79,25 @@ install:
6879
# VS tools instead of the also installed Py27 VS compiler (which wouldn't need this workarounds...)
6980
- cmd: copy "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat" "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat"
7081

82+
# For building, use a new environment which only includes the requirements for mpl
7183
# same things as the requirements in ci/conda_recipe/meta.yaml
72-
- cmd: conda create -y -q -n test-environment python=%PYTHON_VERSION% pip setuptools numpy python-dateutil freetype msinttypes tk pyparsing pytz tornado libpng zlib pyqt cycler nose mock msvc_runtime
84+
# if conda-forge gets a new pyqt, it might be nice to install it as well to have more backends
85+
# https://github.com/conda-forge/conda-forge.github.io/issues/157#issuecomment-223536381
86+
- cmd: conda create -q -n test-environment python=%PYTHON_VERSION% pip setuptools numpy python-dateutil freetype=2.6 msinttypes "tk=8.5" pyparsing pytz tornado "libpng>=1.6.21,<1.7" "zlib=1.2" "cycler>=0.10" nose mock
7387
- activate test-environment
7488
- cmd: echo %PYTHON_VERSION% %TARGET_ARCH%
75-
- cmd: IF %PYTHON_VERSION% == 2.7 conda install -y functools32
89+
- cmd: IF %PYTHON_VERSION% == 2.7 conda install -q functools32
7690

7791
# Let the install prefer the static builds of the libs
7892
- set LIBRARY_LIB=%CONDA_PREFIX%\Library\lib
7993
- cmd: 'mkdir lib || cmd /c "exit /b 0"'
80-
- copy %LIBRARY_LIB%\zlibstatic.lib lib\z.lib
81-
- copy %LIBRARY_LIB%\libpng_static.lib lib\png.lib
94+
- copy /Y %LIBRARY_LIB%\zlibstatic.lib lib\z.lib
95+
- copy /Y %LIBRARY_LIB%\libpng_static.lib lib\png.lib
96+
# These z.lib / png.lib are not static versions but files which end up as
97+
# dependencies to the dll file. This is fine for the conda build, but not here
98+
# and for the wheels
99+
- del %LIBRARY_LIB%\png.lib
100+
- del %LIBRARY_LIB%\z.lib
82101
- set MPLBASEDIRLIST=%CONDA_PREFIX%\Library\;.
83102
# enables the local freetype build
84103
- copy ci\travis\setup.cfg .
@@ -88,17 +107,42 @@ install:
88107
test_script:
89108
# Now build the thing..
90109
- '%CMD_IN_ENV% python setup.py develop'
110+
# these should show no z, png, or freetype dll...
111+
- set "DUMPBIN=%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe"
112+
#- cmd: '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\_png*.pyd'
113+
#- cmd: '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\ft2font*.pyd'
114+
- cmd: '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\ft2font*.pyd | findstr freetype.*.dll && exit /b 1 || exit /b 0'
115+
- cmd: '"%DUMPBIN%" /DEPENDENTS lib\\matplotlib\\_png*.pyd | findstr z.*.dll && exit /b 1 || exit /b 0'
116+
- cmd: '"%DUMPBIN%" /DEPENDENTS lib\\matplotlib\\_png*.pyd | findstr png.*.dll && exit /b 1 || exit /b 0'
117+
118+
# this are optional dependencies so that we don't skip so many tests...
119+
- cmd: conda install -q pillow miktex
120+
# autoinstall latex packages (0=no, 1=autoinstall, 2=ask)
121+
# this adds this to the registry!
122+
- cmd: initexmf --set-config-value "[MPM]AutoInstall=1"
123+
# we need to put the real exe files into PATH as subprocess can't call bat files
124+
# this works for the "old" version of the miktex package, then next version should
125+
# not need it
126+
- set "PATH=%PATH%;%CONDA_PREFIX%\Library\miktex\miktex\bin"
127+
# missing packages on conda-forge for ffmpeg avconv mencoder imagemagick inkscape
128+
- cmd: conda install -q -c menpo ffmpeg # a repackaged version
129+
# This install sometimes failed randomly :-(
130+
#- cmd: choco install imagemagick
131+
# only install inkscape during one test run as it increases the runtime of one
132+
# test run from 13 min -> 30 min
133+
- cmd: if x%TEST_ALL_IMAGES% == xyes; choco install inkscape
134+
- cmd: if x%TEST_ALL_IMAGES% == xyes; set "PATH=%PATH%;C:\Program Files\Inkscape\inkscape.com"
91135
# Test import of tkagg backend
92136
- python -c "import matplotlib as m; m.use('tkagg'); import matplotlib.pyplot as plt; print(plt.get_backend())"
93137
# tests
94138
- python tests.py
95-
# remove to get around libpng issue?
139+
# Generate a html for visual tests
96140
- python visual_tests.py
97141

98142
after_test:
99143
# After the tests were a success, build packages (wheels and conda)
100144

101-
# Build the wheel
145+
# Build the wheel with the static libs
102146
# Hide the output, the copied files really clutter the build log...
103147
- cmd: '%CMD_IN_ENV% python setup.py bdist_wheel > NUL:'
104148

@@ -112,7 +156,8 @@ after_test:
112156
- cmd: path
113157
- cmd: where python
114158
- cmd: '%CMD_IN_ENV% conda config --get channels'
115-
# - cmd: '%CMD_IN_ENV% conda build .\ci\conda_recipe'
159+
# currently disabled as conda-build errors :-(
160+
#- cmd: '%CMD_IN_ENV% conda build -q .\ci\conda_recipe'
116161

117162
# Move the conda package into the dist directory, to register it
118163
# as an "artifact" for Appveyor.

build_alllocal.cmd

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
:: This assumes you have installed all the dependencies via conda packages:
22
:: # create a new environment with the required packages
3-
:: conda create -n "matplotlib_build" python=3.4 numpy python-dateutil pyparsing pytz tornado pyqt cycler tk libpng zlib freetype
3+
:: conda create -n "matplotlib_build" python=3.4 numpy python-dateutil pyparsing pytz tornado "cycler>=0.10" tk libpng zlib freetype
44
:: activate matplotlib_build
5+
:: if you want qt backend, you also have to install pyqt
6+
:: conda install pyqt
57
:: # this package is only available in the conda-forge channel
68
:: conda install -c conda-forge msinttypes
79
:: if you build on py2.7:
@@ -15,20 +17,20 @@ IF [%1]==[] (
1517
echo Using user supplied target: %TARGET%
1618
)
1719

18-
IF NOT DEFINED CONDA_DEFAULT_ENV (
20+
IF NOT DEFINED CONDA_PREFIX (
1921
echo No Conda env activated: you need to create a conda env with the right packages and activate it!
2022
GOTO:eof
2123
)
2224

2325
:: copy the libs which have "wrong" names
24-
set LIBRARY_LIB=%CONDA_DEFAULT_ENV%\Library\lib
26+
set LIBRARY_LIB=%CONDA_PREFIX%\Library\lib
2527
mkdir lib || cmd /c "exit /b 0"
2628
copy %LIBRARY_LIB%\zlibstatic.lib lib\z.lib
2729
copy %LIBRARY_LIB%\libpng_static.lib lib\png.lib
2830

2931
:: Make the header files and the rest of the static libs available during the build
30-
:: CONDA_DEFAULT_ENV is a env variable which is set to the currently active environment path
31-
set MPLBASEDIRLIST=%CONDA_DEFAULT_ENV%\Library\;.
32+
:: CONDA_PREFIX is a env variable which is set to the currently active environment path
33+
set MPLBASEDIRLIST=%CONDA_PREFIX%\Library\;.
3234

3335
:: build the target
3436
python setup.py %TARGET%

ci/conda_recipe/bld.bat

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@ ECHO tests = False >> setup.cfg
88
ECHO sample_data = False >> setup.cfg
99
ECHO toolkits_tests = False >> setup.cfg
1010

11-
%PYTHON% setup.py install
11+
@rem workaround for https://github.com/matplotlib/matplotlib/issues/6460
12+
@rem see also https://github.com/conda-forge/libpng-feedstock/pull/4
13+
copy /y %LIBRARY_LIB%\libpng16.lib %LIBRARY_LIB%\png.lib
14+
15+
%PYTHON% setup.py install --single-version-externally-managed --record=record.txt
1216
if errorlevel 1 exit 1

ci/conda_recipe/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ cat setup.cfg
3333
sed -i.bak "s|/usr/local|$PREFIX|" setupext.py
3434

3535

36-
$PYTHON setup.py install
36+
$PYTHON setup.py install --single-version-externally-managed --record=record.txt
3737

ci/conda_recipe/condaversion.patch

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ index 8af8b6d..4e4f9d2 100644
1212

1313
# These are the packages in the order we want to display them. This
1414
# list may contain strings to create section headers for the display.
15+

ci/conda_recipe/meta.yaml

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
package:
55
name: matplotlib
6-
version: 1.5.1.9
6+
version: 1.9.9
77

88
source:
99
path: ../../
@@ -13,50 +13,47 @@ source:
1313
- cfg_qt4agg.patch # [linux]
1414
# Patches the matplotlibrc template to default to Qt4.
1515
- rctmp_pyside.patch # [not osx]
16-
# Patches setupext to look in PREFIX for the tcl/tk headers.
17-
- osx-tk.patch # [osx]
1816
# dynamic version from git
19-
# we can't use condas usual dynamic versions as setup.py uses a guard
20-
# around the setup call against importing, which is done internaly
21-
# by conda build to get the version.
22-
# https://github.com/matplotlib/matplotlib/pull/5629#issuecomment-167243654
17+
# we can't use condas usual dynamic versions as setup.py uses
18+
# multiprocessing during the configure stage and this seems to confuse conda-build.
19+
# https://github.com/conda/conda-build/issues/1061
2320
- condaversion.patch
2421

22+
2523
requirements:
2624
build:
2725
- python
2826
- setuptools
27+
- pkg-config # [not win]
2928
- numpy x.x
3029
- python-dateutil
31-
- freetype
32-
- msinttypes # [win]
33-
- cycler
30+
- freetype 2.6*
31+
- msinttypes # [win]
32+
- cycler >=0.10
3433
- nose
3534
- pyparsing
3635
- pytz
37-
# - py2cairo # [linux and py2k]
36+
# - py2cairo # [linux and py2k]
3837
- tornado
39-
- libpng
40-
- zlib # [win]
41-
- pyqt # [not osx]
42-
- tk # [linux and win]
43-
- functools32 # [py2k]
44-
- msvc_runtime # [win]
38+
- libpng >=1.6.21,<1.7
39+
- zlib 1.2* # [win]
40+
- pyqt # [not osx]
41+
- tk 8.5* # [linux]
42+
- functools32 # [py2k]
4543

4644
run:
4745
- python
4846
- numpy x.x
49-
- cycler
47+
- cycler >=0.10
5048
- python-dateutil
51-
- freetype
49+
- freetype 2.6*
5250
- pytz
5351
- pyparsing
54-
# - py2cairo # [linux and py2k]
55-
- libpng
56-
- pyqt # [not osx]
57-
- tk # [linux and win]
58-
- functools32 # [py2k]
59-
- msvc_runtime # [win]
52+
# - py2cairo # [linux and py2k]
53+
- libpng >=1.6.21,<1.7
54+
- pyqt # [not osx]
55+
- tk 8.5* # [linux and win]
56+
- functools32 # [py2k]
6057

6158
test:
6259
imports:
@@ -70,6 +67,8 @@ about:
7067

7168
extra:
7269
recipe-maintainers:
70+
- janschulz # only in the mpl repository
71+
- mdboom # rest form conda-forge
72+
- ocefpaf
7373
- pelson
7474
- tacaswell
75-
- JanSchulz
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""
22
Demo of scatter plot on a polar axis.
33
4-
Size increases radially in this example and color increases with angle (just to
5-
verify the symbols are being scattered correctly).
4+
Size increases radially in this example and color increases with angle
5+
(just to verify the symbols are being scattered correctly).
66
"""
77
import numpy as np
88
import matplotlib.pyplot as plt
@@ -11,11 +11,11 @@
1111
N = 150
1212
r = 2 * np.random.rand(N)
1313
theta = 2 * np.pi * np.random.rand(N)
14-
area = 200 * r**2 * np.random.rand(N)
14+
area = 200 * r**2
1515
colors = theta
1616

1717
ax = plt.subplot(111, projection='polar')
18-
c = plt.scatter(theta, r, c=colors, s=area, cmap=plt.cm.hsv)
18+
c = ax.scatter(theta, r, c=colors, s=area, cmap=plt.cm.hsv)
1919
c.set_alpha(0.75)
2020

2121
plt.show()

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2470,7 +2470,8 @@ def grid(self, b=None, which='major', axis='both', **kwargs):
24702470
"""
24712471
if len(kwargs):
24722472
b = True
2473-
b = _string_to_bool(b)
2473+
elif b is not None:
2474+
b = _string_to_bool(b)
24742475

24752476
if axis == 'x' or axis == 'both':
24762477
self.xaxis.grid(b, which=which, **kwargs)

0 commit comments

Comments
 (0)