Skip to content

Commit a495675

Browse files
committed
Merge branch 'v2.x'
2 parents 7ebf2fa + f00274f commit a495675

23 files changed

+107
-58
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ before_install:
8989
pip install --upgrade virtualenv
9090
python -m virtualenv venv
9191
source venv/bin/activate
92+
# test with non-ascii in path
93+
mkdir /tmp/λ
94+
export PATH=$PATH:/tmp/λ
9295
export PATH=/usr/lib/ccache:$PATH
9396
else
9497
brew update
@@ -138,8 +141,7 @@ install:
138141
fi;
139142
- |
140143
# Install matplotlib
141-
pip install -e .
142-
- |
144+
pip install -ve .
143145
144146
script:
145147
# The number of processes is hardcoded, because using too many causes the

doc/api/api_changes.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,20 @@ replaced by ``nipy_spectral`` and ``nipy_spectral_r`` since Matplotlib
201201
raised a warning. As of Matplotlib 2.0.0, using the old names raises a
202202
deprecation warning. In the future, using the old names will raise an error.
203203

204+
Default install no longer includes test images
205+
----------------------------------------------
206+
207+
To reduce the size of wheels and source installs, the tests and
208+
baseline images are no longer included by default.
209+
210+
To restore installing the tests and images, use a `setup.cfg` with ::
211+
212+
[packages]
213+
tests = True
214+
toolkits_tests = True
215+
216+
in the source directory at build/install time.
217+
204218
Changes in 1.5.3
205219
================
206220

doc/devel/contributing.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ the env ``MPLLOCALFREETYPE`` as::
7777

7878
export MPLLOCALFREETYPE=1
7979

80-
or copy :file:`setup.cfg.template` to :file:`setup.cfg` and edit to contain ::
80+
or copy :file:`setup.cfg.template` to :file:`setup.cfg` and edit it to contain ::
8181

8282
[test]
8383
local_freetype = True
@@ -107,9 +107,15 @@ Alternatively, if you do ::
107107

108108
all of the files will be copied to the installation directory however,
109109
you will have to rerun this command every time the source is changed.
110+
Additionally you will need to copy :file:`setup.cfg.template` to
111+
:file:`setup.cfg` and edit it to contain ::
110112

113+
[test]
114+
local_freetype = True
115+
tests = True
111116

112-
You can then run the tests to check your work environment is set up properly::
117+
In either case you can then run the tests to check your work
118+
environment is set up properly::
113119

114120
python tests.py
115121

doc/devel/testing.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ matplotlib source directory::
4545

4646
[test]
4747
local_freetype = True
48+
tests = True
4849

4950
or by setting the ``MPLLOCALFREETYPE`` environmental variable to any true
5051
value.

lib/matplotlib/__init__.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@ def ge(self, level):
359359

360360
def checkdep_dvipng():
361361
try:
362-
s = subprocess.Popen(['dvipng', '-version'], stdout=subprocess.PIPE,
362+
s = subprocess.Popen([str('dvipng'), '-version'],
363+
stdout=subprocess.PIPE,
363364
stderr=subprocess.PIPE)
364365
stdout, stderr = s.communicate()
365366
line = stdout.decode('ascii').split('\n')[1]
@@ -379,7 +380,7 @@ def checkdep_ghostscript():
379380
for gs_exec in gs_execs:
380381
try:
381382
s = subprocess.Popen(
382-
[gs_exec, '--version'], stdout=subprocess.PIPE,
383+
[str(gs_exec), '--version'], stdout=subprocess.PIPE,
383384
stderr=subprocess.PIPE)
384385
stdout, stderr = s.communicate()
385386
if s.returncode == 0:
@@ -395,7 +396,7 @@ def checkdep_ghostscript():
395396

396397
def checkdep_tex():
397398
try:
398-
s = subprocess.Popen(['tex', '-version'], stdout=subprocess.PIPE,
399+
s = subprocess.Popen([str('tex'), '-version'], stdout=subprocess.PIPE,
399400
stderr=subprocess.PIPE)
400401
stdout, stderr = s.communicate()
401402
line = stdout.decode('ascii').split('\n')[0]
@@ -409,7 +410,7 @@ def checkdep_tex():
409410

410411
def checkdep_pdftops():
411412
try:
412-
s = subprocess.Popen(['pdftops', '-v'], stdout=subprocess.PIPE,
413+
s = subprocess.Popen([str('pdftops'), '-v'], stdout=subprocess.PIPE,
413414
stderr=subprocess.PIPE)
414415
stdout, stderr = s.communicate()
415416
lines = stderr.decode('ascii').split('\n')
@@ -424,7 +425,8 @@ def checkdep_pdftops():
424425
def checkdep_inkscape():
425426
if checkdep_inkscape.version is None:
426427
try:
427-
s = subprocess.Popen(['inkscape', '-V'], stdout=subprocess.PIPE,
428+
s = subprocess.Popen([str('inkscape'), '-V'],
429+
stdout=subprocess.PIPE,
428430
stderr=subprocess.PIPE)
429431
stdout, stderr = s.communicate()
430432
lines = stdout.decode('ascii').split('\n')
@@ -442,7 +444,8 @@ def checkdep_inkscape():
442444
@cbook.deprecated("2.1")
443445
def checkdep_xmllint():
444446
try:
445-
s = subprocess.Popen(['xmllint', '--version'], stdout=subprocess.PIPE,
447+
s = subprocess.Popen([str('xmllint'), '--version'],
448+
stdout=subprocess.PIPE,
446449
stderr=subprocess.PIPE)
447450
stdout, stderr = s.communicate()
448451
lines = stderr.decode('ascii').split('\n')

lib/matplotlib/animation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def bin_path(cls):
372372
subclass. This is a class method so that the tool can be looked for
373373
before making a particular MovieWriter subclass available.
374374
'''
375-
return rcParams[cls.exec_key]
375+
return str(rcParams[cls.exec_key])
376376

377377
@classmethod
378378
def isAvailable(cls):

lib/matplotlib/backends/backend_pgf.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
# assuming fontconfig is installed and the command 'fc-list' exists
4646
try:
4747
# list scalable (non-bitmap) fonts
48-
fc_list = check_output(['fc-list', ':outline,scalable', 'family'])
48+
fc_list = check_output([str('fc-list'), ':outline,scalable', 'family'])
4949
fc_list = fc_list.decode('utf8')
5050
system_fonts = [f.split(',')[0] for f in fc_list.splitlines()]
5151
system_fonts = list(set(system_fonts))
@@ -179,7 +179,7 @@ def make_pdf_to_png_converter():
179179
tools_available = []
180180
# check for pdftocairo
181181
try:
182-
check_output(["pdftocairo", "-v"], stderr=subprocess.STDOUT)
182+
check_output([str("pdftocairo"), "-v"], stderr=subprocess.STDOUT)
183183
tools_available.append("pdftocairo")
184184
except:
185185
pass
@@ -191,14 +191,14 @@ def make_pdf_to_png_converter():
191191
# pick converter
192192
if "pdftocairo" in tools_available:
193193
def cairo_convert(pdffile, pngfile, dpi):
194-
cmd = ["pdftocairo", "-singlefile", "-png",
194+
cmd = [str("pdftocairo"), "-singlefile", "-png",
195195
"-r %d" % dpi, pdffile, os.path.splitext(pngfile)[0]]
196196
# for some reason this doesn't work without shell
197-
check_output(" ".join(cmd), shell=True, stderr=subprocess.STDOUT)
197+
check_output(cmd, shell=True, stderr=subprocess.STDOUT)
198198
return cairo_convert
199199
elif "gs" in tools_available:
200200
def gs_convert(pdffile, pngfile, dpi):
201-
cmd = [gs, '-dQUIET', '-dSAFER', '-dBATCH', '-dNOPAUSE', '-dNOPROMPT',
201+
cmd = [str(gs), '-dQUIET', '-dSAFER', '-dBATCH', '-dNOPAUSE', '-dNOPROMPT',
202202
'-sDEVICE=png16m', '-dUseCIEColor', '-dTextAlphaBits=4',
203203
'-dGraphicsAlphaBits=4', '-dDOINTERPOLATE', '-sOutputFile=%s' % pngfile,
204204
'-r%d' % dpi, pdffile]
@@ -300,7 +300,7 @@ def __init__(self):
300300
self.latex_header = LatexManager._build_latex_header()
301301
latex_end = "\n\\makeatletter\n\\@@end\n"
302302
try:
303-
latex = subprocess.Popen([self.texcommand, "-halt-on-error"],
303+
latex = subprocess.Popen([str(self.texcommand), "-halt-on-error"],
304304
stdin=subprocess.PIPE,
305305
stdout=subprocess.PIPE,
306306
cwd=self.tmpdir)
@@ -318,7 +318,7 @@ def __init__(self):
318318
raise LatexError("LaTeX returned an error, probably missing font or error in preamble:\n%s" % stdout)
319319

320320
# open LaTeX process for real work
321-
latex = subprocess.Popen([self.texcommand, "-halt-on-error"],
321+
latex = subprocess.Popen([str(self.texcommand), "-halt-on-error"],
322322
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
323323
cwd=self.tmpdir)
324324
self.latex = latex
@@ -899,7 +899,7 @@ def _print_pdf_to_fh(self, fh, *args, **kwargs):
899899
fh_tex.write(latexcode)
900900

901901
texcommand = get_texcommand()
902-
cmdargs = [texcommand, "-interaction=nonstopmode",
902+
cmdargs = [str(texcommand), "-interaction=nonstopmode",
903903
"-halt-on-error", "figure.tex"]
904904
try:
905905
check_output(cmdargs, stderr=subprocess.STDOUT, cwd=tmpdir)

lib/matplotlib/cbook.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ def report_memory(i=0): # argument may go away
14671467
pid = os.getpid()
14681468
if sys.platform == 'sunos5':
14691469
try:
1470-
a2 = Popen('ps -p %d -o osz' % pid, shell=True,
1470+
a2 = Popen(str('ps -p %d -o osz') % pid, shell=True,
14711471
stdout=PIPE).stdout.readlines()
14721472
except OSError:
14731473
raise NotImplementedError(
@@ -1476,7 +1476,7 @@ def report_memory(i=0): # argument may go away
14761476
mem = int(a2[-1].strip())
14771477
elif sys.platform.startswith('linux'):
14781478
try:
1479-
a2 = Popen('ps -p %d -o rss,sz' % pid, shell=True,
1479+
a2 = Popen(str('ps -p %d -o rss,sz') % pid, shell=True,
14801480
stdout=PIPE).stdout.readlines()
14811481
except OSError:
14821482
raise NotImplementedError(
@@ -1485,7 +1485,7 @@ def report_memory(i=0): # argument may go away
14851485
mem = int(a2[1].split()[1])
14861486
elif sys.platform.startswith('darwin'):
14871487
try:
1488-
a2 = Popen('ps -p %d -o rss,vsz' % pid, shell=True,
1488+
a2 = Popen(str('ps -p %d -o rss,vsz') % pid, shell=True,
14891489
stdout=PIPE).stdout.readlines()
14901490
except OSError:
14911491
raise NotImplementedError(
@@ -1494,7 +1494,7 @@ def report_memory(i=0): # argument may go away
14941494
mem = int(a2[1].split()[0])
14951495
elif sys.platform.startswith('win'):
14961496
try:
1497-
a2 = Popen(["tasklist", "/nh", "/fi", "pid eq %d" % pid],
1497+
a2 = Popen([str("tasklist"), "/nh", "/fi", "pid eq %d" % pid],
14981498
stdout=PIPE).stdout.read()
14991499
except OSError:
15001500
raise NotImplementedError(

lib/matplotlib/collections.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,7 @@ def update_from(self, other):
771771
self._facecolors = other._facecolors
772772
self._linewidths = other._linewidths
773773
self._linestyles = other._linestyles
774+
self._us_linestyles = other._us_linestyles
774775
self._pickradius = other._pickradius
775776
self._hatch = other._hatch
776777

lib/matplotlib/dviread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ def find_tex_file(filename, format=None):
970970
The library that :program:`kpsewhich` is part of.
971971
"""
972972

973-
cmd = ['kpsewhich']
973+
cmd = [str('kpsewhich')]
974974
if format is not None:
975975
cmd += ['--format=' + format]
976976
cmd += [filename]

0 commit comments

Comments
 (0)