X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ before_install:
pip install --upgrade virtualenv
python -m virtualenv venv
source venv/bin/activate
# test with non-ascii in path
mkdir /tmp/λ
export PATH=$PATH:/tmp/λ
export PATH=/usr/lib/ccache:$PATH
else
brew update
Expand Down Expand Up @@ -138,8 +141,7 @@ install:
fi;
- |
# Install matplotlib
pip install -e .
- |
pip install -ve .

script:
# The number of processes is hardcoded, because using too many causes the
Expand Down
14 changes: 14 additions & 0 deletions doc/api/api_changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,20 @@ replaced by ``nipy_spectral`` and ``nipy_spectral_r`` since Matplotlib
raised a warning. As of Matplotlib 2.0.0, using the old names raises a
deprecation warning. In the future, using the old names will raise an error.

Default install no longer includes test images
----------------------------------------------

To reduce the size of wheels and source installs, the tests and
baseline images are no longer included by default.

To restore installing the tests and images, use a `setup.cfg` with ::

[packages]
tests = True
toolkits_tests = True

in the source directory at build/install time.

Changes in 1.5.3
================

Expand Down
10 changes: 8 additions & 2 deletions doc/devel/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ the env ``MPLLOCALFREETYPE`` as::

export MPLLOCALFREETYPE=1

or copy :file:`setup.cfg.template` to :file:`setup.cfg` and edit to contain ::
or copy :file:`setup.cfg.template` to :file:`setup.cfg` and edit it to contain ::

[test]
local_freetype = True
Expand Down Expand Up @@ -107,9 +107,15 @@ Alternatively, if you do ::

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

[test]
local_freetype = True
tests = True

You can then run the tests to check your work environment is set up properly::
In either case you can then run the tests to check your work
environment is set up properly::

python tests.py

Expand Down
1 change: 1 addition & 0 deletions doc/devel/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ matplotlib source directory::

[test]
local_freetype = True
tests = True

or by setting the ``MPLLOCALFREETYPE`` environmental variable to any true
value.
Expand Down
15 changes: 9 additions & 6 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ def ge(self, level):

def checkdep_dvipng():
try:
s = subprocess.Popen(['dvipng', '-version'], stdout=subprocess.PIPE,
s = subprocess.Popen([str('dvipng'), '-version'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = s.communicate()
line = stdout.decode('ascii').split('\n')[1]
Expand All @@ -379,7 +380,7 @@ def checkdep_ghostscript():
for gs_exec in gs_execs:
try:
s = subprocess.Popen(
[gs_exec, '--version'], stdout=subprocess.PIPE,
[str(gs_exec), '--version'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = s.communicate()
if s.returncode == 0:
Expand All @@ -395,7 +396,7 @@ def checkdep_ghostscript():

def checkdep_tex():
try:
s = subprocess.Popen(['tex', '-version'], stdout=subprocess.PIPE,
s = subprocess.Popen([str('tex'), '-version'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = s.communicate()
line = stdout.decode('ascii').split('\n')[0]
Expand All @@ -409,7 +410,7 @@ def checkdep_tex():

def checkdep_pdftops():
try:
s = subprocess.Popen(['pdftops', '-v'], stdout=subprocess.PIPE,
s = subprocess.Popen([str('pdftops'), '-v'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = s.communicate()
lines = stderr.decode('ascii').split('\n')
Expand All @@ -424,7 +425,8 @@ def checkdep_pdftops():
def checkdep_inkscape():
if checkdep_inkscape.version is None:
try:
s = subprocess.Popen(['inkscape', '-V'], stdout=subprocess.PIPE,
s = subprocess.Popen([str('inkscape'), '-V'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = s.communicate()
lines = stdout.decode('ascii').split('\n')
Expand All @@ -442,7 +444,8 @@ def checkdep_inkscape():
@cbook.deprecated("2.1")
def checkdep_xmllint():
try:
s = subprocess.Popen(['xmllint', '--version'], stdout=subprocess.PIPE,
s = subprocess.Popen([str('xmllint'), '--version'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = s.communicate()
lines = stderr.decode('ascii').split('\n')
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def bin_path(cls):
subclass. This is a class method so that the tool can be looked for
before making a particular MovieWriter subclass available.
'''
return rcParams[cls.exec_key]
return str(rcParams[cls.exec_key])

@classmethod
def isAvailable(cls):
Expand Down
16 changes: 8 additions & 8 deletions lib/matplotlib/backends/backend_pgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# assuming fontconfig is installed and the command 'fc-list' exists
try:
# list scalable (non-bitmap) fonts
fc_list = check_output(['fc-list', ':outline,scalable', 'family'])
fc_list = check_output([str('fc-list'), ':outline,scalable', 'family'])
fc_list = fc_list.decode('utf8')
system_fonts = [f.split(',')[0] for f in fc_list.splitlines()]
system_fonts = list(set(system_fonts))
Expand Down Expand Up @@ -179,7 +179,7 @@ def make_pdf_to_png_converter():
tools_available = []
# check for pdftocairo
try:
check_output(["pdftocairo", "-v"], stderr=subprocess.STDOUT)
check_output([str("pdftocairo"), "-v"], stderr=subprocess.STDOUT)
tools_available.append("pdftocairo")
except:
pass
Expand All @@ -191,14 +191,14 @@ def make_pdf_to_png_converter():
# pick converter
if "pdftocairo" in tools_available:
def cairo_convert(pdffile, pngfile, dpi):
cmd = ["pdftocairo", "-singlefile", "-png",
cmd = [str("pdftocairo"), "-singlefile", "-png",
"-r %d" % dpi, pdffile, os.path.splitext(pngfile)[0]]
# for some reason this doesn't work without shell
check_output(" ".join(cmd), shell=True, stderr=subprocess.STDOUT)
check_output(cmd, shell=True, stderr=subprocess.STDOUT)
return cairo_convert
elif "gs" in tools_available:
def gs_convert(pdffile, pngfile, dpi):
cmd = [gs, '-dQUIET', '-dSAFER', '-dBATCH', '-dNOPAUSE', '-dNOPROMPT',
cmd = [str(gs), '-dQUIET', '-dSAFER', '-dBATCH', '-dNOPAUSE', '-dNOPROMPT',
'-sDEVICE=png16m', '-dUseCIEColor', '-dTextAlphaBits=4',
'-dGraphicsAlphaBits=4', '-dDOINTERPOLATE', '-sOutputFile=%s' % pngfile,
'-r%d' % dpi, pdffile]
Expand Down Expand Up @@ -300,7 +300,7 @@ def __init__(self):
self.latex_header = LatexManager._build_latex_header()
latex_end = "\n\\makeatletter\n\\@@end\n"
try:
latex = subprocess.Popen([self.texcommand, "-halt-on-error"],
latex = subprocess.Popen([str(self.texcommand), "-halt-on-error"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
cwd=self.tmpdir)
Expand All @@ -318,7 +318,7 @@ def __init__(self):
raise LatexError("LaTeX returned an error, probably missing font or error in preamble:\n%s" % stdout)

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

texcommand = get_texcommand()
cmdargs = [texcommand, "-interaction=nonstopmode",
cmdargs = [str(texcommand), "-interaction=nonstopmode",
"-halt-on-error", "figure.tex"]
try:
check_output(cmdargs, stderr=subprocess.STDOUT, cwd=tmpdir)
Expand Down
8 changes: 4 additions & 4 deletions lib/matplotlib/cbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,7 @@ def report_memory(i=0): # argument may go away
pid = os.getpid()
if sys.platform == 'sunos5':
try:
a2 = Popen('ps -p %d -o osz' % pid, shell=True,
a2 = Popen(str('ps -p %d -o osz') % pid, shell=True,
stdout=PIPE).stdout.readlines()
except OSError:
raise NotImplementedError(
Expand All @@ -1476,7 +1476,7 @@ def report_memory(i=0): # argument may go away
mem = int(a2[-1].strip())
elif sys.platform.startswith('linux'):
try:
a2 = Popen('ps -p %d -o rss,sz' % pid, shell=True,
a2 = Popen(str('ps -p %d -o rss,sz') % pid, shell=True,
stdout=PIPE).stdout.readlines()
except OSError:
raise NotImplementedError(
Expand All @@ -1485,7 +1485,7 @@ def report_memory(i=0): # argument may go away
mem = int(a2[1].split()[1])
elif sys.platform.startswith('darwin'):
try:
a2 = Popen('ps -p %d -o rss,vsz' % pid, shell=True,
a2 = Popen(str('ps -p %d -o rss,vsz') % pid, shell=True,
stdout=PIPE).stdout.readlines()
except OSError:
raise NotImplementedError(
Expand All @@ -1494,7 +1494,7 @@ def report_memory(i=0): # argument may go away
mem = int(a2[1].split()[0])
elif sys.platform.startswith('win'):
try:
a2 = Popen(["tasklist", "/nh", "/fi", "pid eq %d" % pid],
a2 = Popen([str("tasklist"), "/nh", "/fi", "pid eq %d" % pid],
stdout=PIPE).stdout.read()
except OSError:
raise NotImplementedError(
Expand Down
1 change: 1 addition & 0 deletions lib/matplotlib/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@ def update_from(self, other):
self._facecolors = other._facecolors
self._linewidths = other._linewidths
self._linestyles = other._linestyles
self._us_linestyles = other._us_linestyles
self._pickradius = other._pickradius
self._hatch = other._hatch

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/dviread.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ def find_tex_file(filename, format=None):
The library that :program:`kpsewhich` is part of.
"""

cmd = ['kpsewhich']
cmd = [str('kpsewhich')]
if format is not None:
cmd += ['--format=' + format]
cmd += [filename]
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def _call_fc_list():
'This may take a moment.'))
timer.start()
try:
out = subprocess.check_output(['fc-list', '--format=%{file}'])
out = subprocess.check_output([str('fc-list'), '--format=%{file}'])
except (OSError, subprocess.CalledProcessError):
return []
finally:
Expand Down
5 changes: 2 additions & 3 deletions lib/matplotlib/legend_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,11 @@ def get_numpoints(self, legend):

def _default_update_prop(self, legend_handle, orig_handle):
lw = orig_handle.get_linewidths()[0]
dashes = orig_handle.get_dashes()[0]
dashes = orig_handle._us_linestyles[0]
color = orig_handle.get_colors()[0]
legend_handle.set_color(color)
legend_handle.set_linestyle(dashes)
legend_handle.set_linewidth(lw)
if dashes[0] is not None: # dashed line
legend_handle.set_dashes(dashes[1])

def create_artists(self, legend, orig_handle,
xdescent, ydescent, width, height, fontsize, trans):
Expand Down
2 changes: 2 additions & 0 deletions lib/matplotlib/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,9 @@ def update_from(self, other):
self._markeredgecolor = other._markeredgecolor
self._markeredgewidth = other._markeredgewidth
self._dashSeq = other._dashSeq
self._us_dashSeq = other._us_dashSeq
self._dashOffset = other._dashOffset
self._us_dashOffset = other._us_dashOffset
self._dashcapstyle = other._dashcapstyle
self._dashjoinstyle = other._dashjoinstyle
self._solidcapstyle = other._solidcapstyle
Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ def update_from(self, other):
self._facecolor = other._facecolor
self._fill = other._fill
self._hatch = other._hatch
self._linewidth = other._linewidth
# Use setters, getters where we need the extra work they do.
self.set_linestyle(other._linestyle) # also sets dash properties
# copy the unscaled dash pattern
self._us_dashes = other._us_dashes
self.set_linewidth(other._linewidth) # also sets dash properties
self.set_transform(other.get_data_transform())

def get_extents(self):
Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1139,10 +1139,10 @@ def validate_animation_writer_path(p):
'date.autoformatter.year': ['%Y', six.text_type],
'date.autoformatter.month': ['%Y-%m', six.text_type],
'date.autoformatter.day': ['%Y-%m-%d', six.text_type],
'date.autoformatter.hour': ['%H:%M', six.text_type],
'date.autoformatter.minute': ['%H:%M:%S', six.text_type],
'date.autoformatter.hour': ['%m-%d %H', six.text_type],
'date.autoformatter.minute': ['%d %H:%M', six.text_type],
'date.autoformatter.second': ['%H:%M:%S', six.text_type],
'date.autoformatter.microsecond': ['%H:%M:%S.%f', six.text_type],
'date.autoformatter.microsecond': ['%M:%S.%f', six.text_type],

#legend properties
'legend.fancybox': [True, validate_bool],
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/sphinxext/tests/test_tinypages.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def setup_class(cls):
cls.html_dir = pjoin(cls.page_build, 'html')
cls.doctree_dir = pjoin(cls.page_build, 'doctrees')
# Build the pages with warnings turned into errors
cmd = ['sphinx-build', '-W', '-b', 'html',
cmd = [str('sphinx-build'), '-W', '-b', 'html',
'-d', cls.doctree_dir,
TINY_PAGES,
cls.html_dir]
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/testing/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ def _update_converter():
gs, gs_v = matplotlib.checkdep_ghostscript()
if gs_v is not None:
def cmd(old, new):
return [gs, '-q', '-sDEVICE=png16m', '-dNOPAUSE', '-dBATCH',
return [str(gs), '-q', '-sDEVICE=png16m', '-dNOPAUSE', '-dBATCH',
'-sOutputFile=' + new, old]
converter['pdf'] = make_external_conversion_command(cmd)
converter['eps'] = make_external_conversion_command(cmd)

if matplotlib.checkdep_inkscape() is not None:
def cmd(old, new):
return ['inkscape', '-z', old, '--export-png', new]
return [str('inkscape'), '-z', old, '--export-png', new]
converter['svg'] = make_external_conversion_command(cmd)


Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_backend_pgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def check_for(texsystem):
\\@@end
"""
try:
latex = subprocess.Popen([texsystem, "-halt-on-error"],
latex = subprocess.Popen([str(texsystem), "-halt-on-error"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
stdout, stderr = latex.communicate(header.encode("utf8"))
Expand Down
1 change: 0 additions & 1 deletion lib/matplotlib/tests/test_coding_standards.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ def test_pep8_conformance_installed_files():
'tests/test_axes.py',
'tests/test_bbox_tight.py',
'tests/test_image.py',
'tests/test_legend.py',
'tests/test_lines.py',
'tests/test_mathtext.py',
'tests/test_rcparams.py',
Expand Down
Loading
X Tutup