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

Skip to content

Commit ecca88a

Browse files
committed
Merge remote-tracking branch 'upstream/v1.3.x'
Conflicts: lib/matplotlib/__init__.py
2 parents a87f521 + 03e0936 commit ecca88a

File tree

5 files changed

+188
-167
lines changed

5 files changed

+188
-167
lines changed

lib/matplotlib/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,8 @@ class RcParams(dict):
759759
:mod:`matplotlib.rcsetup`
760760
"""
761761

762-
validate = dict((key, converter) for key, (default, converter) in \
763-
defaultParams.iteritems())
762+
validate = dict((key, converter) for key, (default, converter) in
763+
defaultParams.iteritems())
764764
msg_depr = "%s is deprecated and replaced with %s; please use the latter."
765765
msg_depr_ignore = "%s is deprecated and ignored. Use %s"
766766

@@ -1247,6 +1247,7 @@ def test(verbosity=1):
12471247
import nose.plugins.builtin
12481248
from .testing.noseclasses import KnownFailure
12491249
from nose.plugins.manager import PluginManager
1250+
from nose.plugins import multiprocess
12501251

12511252
# store the old values before overriding
12521253
plugins = []
@@ -1256,6 +1257,11 @@ def test(verbosity=1):
12561257
manager = PluginManager(plugins=plugins)
12571258
config = nose.config.Config(verbosity=verbosity, plugins=manager)
12581259

1260+
# Nose doesn't automatically instantiate all of the plugins in the
1261+
# child processes, so we have to provide the multiprocess plugin with
1262+
# a list.
1263+
multiprocess._instantiate_plugins = [KnownFailure]
1264+
12591265
success = nose.run( defaultTest=default_test_modules,
12601266
config=config,
12611267
)

lib/matplotlib/font_manager.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,12 +1324,15 @@ def findfont(prop, fontext='ttf'):
13241324
return result
13251325

13261326
else:
1327-
cachedir = get_cachedir()
1328-
if cachedir is not None:
1329-
if sys.version_info[0] >= 3:
1330-
_fmcache = os.path.join(cachedir, 'fontList.py3k.cache')
1331-
else:
1332-
_fmcache = os.path.join(cachedir, 'fontList.cache')
1327+
if not 'TRAVIS' in os.environ:
1328+
cachedir = get_cachedir()
1329+
if cachedir is not None:
1330+
if sys.version_info[0] >= 3:
1331+
_fmcache = os.path.join(cachedir, 'fontList.py3k.cache')
1332+
else:
1333+
_fmcache = os.path.join(cachedir, 'fontList.cache')
1334+
else:
1335+
_fmcache = None
13331336

13341337
fontManager = None
13351338

lib/matplotlib/tests/test_coding_standards.py

Lines changed: 152 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -15,159 +15,160 @@
1515
import matplotlib
1616

1717

18-
class StandardReportWithExclusions(pep8.StandardReport):
19-
#; A class attribute to store the exception exclusion file patterns.
20-
expected_bad_files = [
21-
'*/matplotlib/__init__.py',
22-
'*/matplotlib/_cm.py',
23-
'*/matplotlib/_mathtext_data.py',
24-
'*/matplotlib/_pylab_helpers.py',
25-
'*/matplotlib/afm.py',
26-
'*/matplotlib/artist.py',
27-
'*/matplotlib/axes.py',
28-
'*/matplotlib/axis.py',
29-
'*/matplotlib/backend_bases.py',
30-
'*/matplotlib/bezier.py',
31-
'*/matplotlib/cbook.py',
32-
'*/matplotlib/collections.py',
33-
'*/matplotlib/docstring.py',
34-
'*/matplotlib/dviread.py',
35-
'*/matplotlib/finance.py',
36-
'*/matplotlib/font_manager.py',
37-
'*/matplotlib/fontconfig_pattern.py',
38-
'*/matplotlib/gridspec.py',
39-
'*/matplotlib/legend.py',
40-
'*/matplotlib/legend_handler.py',
41-
'*/matplotlib/mathtext.py',
42-
'*/matplotlib/mlab.py',
43-
'*/matplotlib/path.py',
44-
'*/matplotlib/patheffects.py',
45-
'*/matplotlib/pylab.py',
46-
'*/matplotlib/pyplot.py',
47-
'*/matplotlib/rcsetup.py',
48-
'*/matplotlib/stackplot.py',
49-
'*/matplotlib/texmanager.py',
50-
'*/matplotlib/text.py',
51-
'*/matplotlib/transforms.py',
52-
'*/matplotlib/type1font.py',
53-
'*/matplotlib/widgets.py',
54-
'*/matplotlib/testing/compare.py',
55-
'*/matplotlib/testing/decorators.py',
56-
'*/matplotlib/testing/image_util.py',
57-
'*/matplotlib/testing/noseclasses.py',
58-
'*/matplotlib/testing/jpl_units/Duration.py',
59-
'*/matplotlib/testing/jpl_units/Epoch.py',
60-
'*/matplotlib/testing/jpl_units/EpochConverter.py',
61-
'*/matplotlib/testing/jpl_units/StrConverter.py',
62-
'*/matplotlib/testing/jpl_units/UnitDbl.py',
63-
'*/matplotlib/testing/jpl_units/UnitDblConverter.py',
64-
'*/matplotlib/testing/jpl_units/UnitDblFormatter.py',
65-
'*/matplotlib/testing/jpl_units/__init__.py',
66-
'*/matplotlib/tri/tricontour.py',
67-
'*/matplotlib/tri/triinterpolate.py',
68-
'*/matplotlib/tri/tripcolor.py',
69-
'*/matplotlib/tri/triplot.py',
70-
'*/matplotlib/tests/__init__.py',
71-
'*/matplotlib/tests/test_agg.py',
72-
'*/matplotlib/tests/test_animation.py',
73-
'*/matplotlib/tests/test_arrow_patches.py',
74-
'*/matplotlib/tests/test_artist.py',
75-
'*/matplotlib/tests/test_axes.py',
76-
'*/matplotlib/tests/test_backend_pdf.py',
77-
'*/matplotlib/tests/test_backend_pgf.py',
78-
'*/matplotlib/tests/test_backend_svg.py',
79-
'*/matplotlib/tests/test_basic.py',
80-
'*/matplotlib/tests/test_bbox_tight.py',
81-
'*/matplotlib/tests/test_cbook.py',
82-
'*/matplotlib/tests/test_colorbar.py',
83-
'*/matplotlib/tests/test_colors.py',
84-
'*/matplotlib/tests/test_compare_images.py',
85-
'*/matplotlib/tests/test_contour.py',
86-
'*/matplotlib/tests/test_dates.py',
87-
'*/matplotlib/tests/test_delaunay.py',
88-
'*/matplotlib/tests/test_dviread.py',
89-
'*/matplotlib/tests/test_image.py',
90-
'*/matplotlib/tests/test_legend.py',
91-
'*/matplotlib/tests/test_lines.py',
92-
'*/matplotlib/tests/test_mathtext.py',
93-
'*/matplotlib/tests/test_patches.py',
94-
'*/matplotlib/tests/test_pickle.py',
95-
'*/matplotlib/tests/test_png.py',
96-
'*/matplotlib/tests/test_rcparams.py',
97-
'*/matplotlib/tests/test_simplification.py',
98-
'*/matplotlib/tests/test_spines.py',
99-
'*/matplotlib/tests/test_streamplot.py',
100-
'*/matplotlib/tests/test_subplots.py',
101-
'*/matplotlib/tests/test_text.py',
102-
'*/matplotlib/tests/test_tightlayout.py',
103-
'*/matplotlib/tests/test_transforms.py',
104-
'*/matplotlib/tests/test_triangulation.py',
105-
'*/matplotlib/compat/subprocess.py',
106-
'*/matplotlib/backends/__init__.py',
107-
'*/matplotlib/backends/backend_agg.py',
108-
'*/matplotlib/backends/backend_cairo.py',
109-
'*/matplotlib/backends/backend_cocoaagg.py',
110-
'*/matplotlib/backends/backend_gdk.py',
111-
'*/matplotlib/backends/backend_gtk.py',
112-
'*/matplotlib/backends/backend_gtk3.py',
113-
'*/matplotlib/backends/backend_gtk3cairo.py',
114-
'*/matplotlib/backends/backend_gtkagg.py',
115-
'*/matplotlib/backends/backend_gtkcairo.py',
116-
'*/matplotlib/backends/backend_macosx.py',
117-
'*/matplotlib/backends/backend_mixed.py',
118-
'*/matplotlib/backends/backend_pdf.py',
119-
'*/matplotlib/backends/backend_pgf.py',
120-
'*/matplotlib/backends/backend_ps.py',
121-
'*/matplotlib/backends/backend_qt4.py',
122-
'*/matplotlib/backends/backend_qt4agg.py',
123-
'*/matplotlib/backends/backend_svg.py',
124-
'*/matplotlib/backends/backend_template.py',
125-
'*/matplotlib/backends/backend_tkagg.py',
126-
'*/matplotlib/backends/backend_webagg.py',
127-
'*/matplotlib/backends/backend_wx.py',
128-
'*/matplotlib/backends/backend_wxagg.py',
129-
'*/matplotlib/backends/qt4_compat.py',
130-
'*/matplotlib/backends/tkagg.py',
131-
'*/matplotlib/backends/windowing.py',
132-
'*/matplotlib/backends/qt4_editor/figureoptions.py',
133-
'*/matplotlib/backends/qt4_editor/formlayout.py',
134-
'*/matplotlib/sphinxext/__init__.py',
135-
'*/matplotlib/sphinxext/ipython_console_highlighting.py',
136-
'*/matplotlib/sphinxext/ipython_directive.py',
137-
'*/matplotlib/sphinxext/mathmpl.py',
138-
'*/matplotlib/sphinxext/only_directives.py',
139-
'*/matplotlib/sphinxext/plot_directive.py',
140-
'*/matplotlib/projections/__init__.py',
141-
'*/matplotlib/projections/geo.py',
142-
'*/matplotlib/projections/polar.py']
143-
144-
#: A class attribute to store patterns which have seen exceptions.
145-
matched_exclusions = set()
146-
147-
def get_file_results(self):
148-
# If the file had no errors, return self.file_errors (which will be 0)
149-
if not self._deferred_print:
150-
return self.file_errors
151-
152-
# Iterate over all of the patterns, to find a possible exclusion. If we
153-
# the filename is to be excluded, go ahead and remove the counts that
154-
# self.error added.
155-
for pattern in self.expected_bad_files:
156-
if fnmatch(self.filename, pattern):
157-
self.matched_exclusions.add(pattern)
158-
# invert the error method's counters.
159-
for _, _, code, _, _ in self._deferred_print:
160-
self.counters[code] -= 1
161-
if self.counters[code] == 0:
162-
self.counters.pop(code)
163-
self.messages.pop(code)
164-
self.file_errors -= 1
165-
self.total_errors -= 1
18+
if HAS_PEP8:
19+
class StandardReportWithExclusions(pep8.StandardReport):
20+
#; A class attribute to store the exception exclusion file patterns.
21+
expected_bad_files = [
22+
'*/matplotlib/__init__.py',
23+
'*/matplotlib/_cm.py',
24+
'*/matplotlib/_mathtext_data.py',
25+
'*/matplotlib/_pylab_helpers.py',
26+
'*/matplotlib/afm.py',
27+
'*/matplotlib/artist.py',
28+
'*/matplotlib/axes.py',
29+
'*/matplotlib/axis.py',
30+
'*/matplotlib/backend_bases.py',
31+
'*/matplotlib/bezier.py',
32+
'*/matplotlib/cbook.py',
33+
'*/matplotlib/collections.py',
34+
'*/matplotlib/docstring.py',
35+
'*/matplotlib/dviread.py',
36+
'*/matplotlib/finance.py',
37+
'*/matplotlib/font_manager.py',
38+
'*/matplotlib/fontconfig_pattern.py',
39+
'*/matplotlib/gridspec.py',
40+
'*/matplotlib/legend.py',
41+
'*/matplotlib/legend_handler.py',
42+
'*/matplotlib/mathtext.py',
43+
'*/matplotlib/mlab.py',
44+
'*/matplotlib/path.py',
45+
'*/matplotlib/patheffects.py',
46+
'*/matplotlib/pylab.py',
47+
'*/matplotlib/pyplot.py',
48+
'*/matplotlib/rcsetup.py',
49+
'*/matplotlib/stackplot.py',
50+
'*/matplotlib/texmanager.py',
51+
'*/matplotlib/text.py',
52+
'*/matplotlib/transforms.py',
53+
'*/matplotlib/type1font.py',
54+
'*/matplotlib/widgets.py',
55+
'*/matplotlib/testing/compare.py',
56+
'*/matplotlib/testing/decorators.py',
57+
'*/matplotlib/testing/image_util.py',
58+
'*/matplotlib/testing/noseclasses.py',
59+
'*/matplotlib/testing/jpl_units/Duration.py',
60+
'*/matplotlib/testing/jpl_units/Epoch.py',
61+
'*/matplotlib/testing/jpl_units/EpochConverter.py',
62+
'*/matplotlib/testing/jpl_units/StrConverter.py',
63+
'*/matplotlib/testing/jpl_units/UnitDbl.py',
64+
'*/matplotlib/testing/jpl_units/UnitDblConverter.py',
65+
'*/matplotlib/testing/jpl_units/UnitDblFormatter.py',
66+
'*/matplotlib/testing/jpl_units/__init__.py',
67+
'*/matplotlib/tri/tricontour.py',
68+
'*/matplotlib/tri/triinterpolate.py',
69+
'*/matplotlib/tri/tripcolor.py',
70+
'*/matplotlib/tri/triplot.py',
71+
'*/matplotlib/tests/__init__.py',
72+
'*/matplotlib/tests/test_agg.py',
73+
'*/matplotlib/tests/test_animation.py',
74+
'*/matplotlib/tests/test_arrow_patches.py',
75+
'*/matplotlib/tests/test_artist.py',
76+
'*/matplotlib/tests/test_axes.py',
77+
'*/matplotlib/tests/test_backend_pdf.py',
78+
'*/matplotlib/tests/test_backend_pgf.py',
79+
'*/matplotlib/tests/test_backend_svg.py',
80+
'*/matplotlib/tests/test_basic.py',
81+
'*/matplotlib/tests/test_bbox_tight.py',
82+
'*/matplotlib/tests/test_cbook.py',
83+
'*/matplotlib/tests/test_colorbar.py',
84+
'*/matplotlib/tests/test_colors.py',
85+
'*/matplotlib/tests/test_compare_images.py',
86+
'*/matplotlib/tests/test_contour.py',
87+
'*/matplotlib/tests/test_dates.py',
88+
'*/matplotlib/tests/test_delaunay.py',
89+
'*/matplotlib/tests/test_dviread.py',
90+
'*/matplotlib/tests/test_image.py',
91+
'*/matplotlib/tests/test_legend.py',
92+
'*/matplotlib/tests/test_lines.py',
93+
'*/matplotlib/tests/test_mathtext.py',
94+
'*/matplotlib/tests/test_patches.py',
95+
'*/matplotlib/tests/test_pickle.py',
96+
'*/matplotlib/tests/test_png.py',
97+
'*/matplotlib/tests/test_rcparams.py',
98+
'*/matplotlib/tests/test_simplification.py',
99+
'*/matplotlib/tests/test_spines.py',
100+
'*/matplotlib/tests/test_streamplot.py',
101+
'*/matplotlib/tests/test_subplots.py',
102+
'*/matplotlib/tests/test_text.py',
103+
'*/matplotlib/tests/test_tightlayout.py',
104+
'*/matplotlib/tests/test_transforms.py',
105+
'*/matplotlib/tests/test_triangulation.py',
106+
'*/matplotlib/compat/subprocess.py',
107+
'*/matplotlib/backends/__init__.py',
108+
'*/matplotlib/backends/backend_agg.py',
109+
'*/matplotlib/backends/backend_cairo.py',
110+
'*/matplotlib/backends/backend_cocoaagg.py',
111+
'*/matplotlib/backends/backend_gdk.py',
112+
'*/matplotlib/backends/backend_gtk.py',
113+
'*/matplotlib/backends/backend_gtk3.py',
114+
'*/matplotlib/backends/backend_gtk3cairo.py',
115+
'*/matplotlib/backends/backend_gtkagg.py',
116+
'*/matplotlib/backends/backend_gtkcairo.py',
117+
'*/matplotlib/backends/backend_macosx.py',
118+
'*/matplotlib/backends/backend_mixed.py',
119+
'*/matplotlib/backends/backend_pdf.py',
120+
'*/matplotlib/backends/backend_pgf.py',
121+
'*/matplotlib/backends/backend_ps.py',
122+
'*/matplotlib/backends/backend_qt4.py',
123+
'*/matplotlib/backends/backend_qt4agg.py',
124+
'*/matplotlib/backends/backend_svg.py',
125+
'*/matplotlib/backends/backend_template.py',
126+
'*/matplotlib/backends/backend_tkagg.py',
127+
'*/matplotlib/backends/backend_webagg.py',
128+
'*/matplotlib/backends/backend_wx.py',
129+
'*/matplotlib/backends/backend_wxagg.py',
130+
'*/matplotlib/backends/qt4_compat.py',
131+
'*/matplotlib/backends/tkagg.py',
132+
'*/matplotlib/backends/windowing.py',
133+
'*/matplotlib/backends/qt4_editor/figureoptions.py',
134+
'*/matplotlib/backends/qt4_editor/formlayout.py',
135+
'*/matplotlib/sphinxext/__init__.py',
136+
'*/matplotlib/sphinxext/ipython_console_highlighting.py',
137+
'*/matplotlib/sphinxext/ipython_directive.py',
138+
'*/matplotlib/sphinxext/mathmpl.py',
139+
'*/matplotlib/sphinxext/only_directives.py',
140+
'*/matplotlib/sphinxext/plot_directive.py',
141+
'*/matplotlib/projections/__init__.py',
142+
'*/matplotlib/projections/geo.py',
143+
'*/matplotlib/projections/polar.py']
144+
145+
#: A class attribute to store patterns which have seen exceptions.
146+
matched_exclusions = set()
147+
148+
def get_file_results(self):
149+
# If the file had no errors, return self.file_errors (which will be 0)
150+
if not self._deferred_print:
166151
return self.file_errors
167152

168-
# Otherwise call the superclass' method to print the bad results.
169-
return super(StandardReportWithExclusions,
170-
self).get_file_results()
153+
# Iterate over all of the patterns, to find a possible exclusion. If we
154+
# the filename is to be excluded, go ahead and remove the counts that
155+
# self.error added.
156+
for pattern in self.expected_bad_files:
157+
if fnmatch(self.filename, pattern):
158+
self.matched_exclusions.add(pattern)
159+
# invert the error method's counters.
160+
for _, _, code, _, _ in self._deferred_print:
161+
self.counters[code] -= 1
162+
if self.counters[code] == 0:
163+
self.counters.pop(code)
164+
self.messages.pop(code)
165+
self.file_errors -= 1
166+
self.total_errors -= 1
167+
return self.file_errors
168+
169+
# Otherwise call the superclass' method to print the bad results.
170+
return super(StandardReportWithExclusions,
171+
self).get_file_results()
171172

172173

173174
def _test_pep8_conformance():

setup.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@
3636
except ImportError:
3737
from distutils.core import setup
3838

39+
# The setuptools version of sdist adds a setup.cfg file to the tree.
40+
# We don't want that, so we simply remove it, and it will fall back to
41+
# vanilla distutils.
42+
try:
43+
from setuptools.command import sdist
44+
except ImportError:
45+
pass
46+
else:
47+
del sdist.sdist.make_release_tree
48+
3949
import setupext
4050
from setupext import print_line, print_raw, print_message, print_status
4151

@@ -228,11 +238,4 @@
228238
# Telling setuptools this prevents it from doing an automatic
229239
# check for zip safety.
230240
zip_safe=False,
231-
232-
# Install our nose plugin so it will always be found
233-
entry_points={
234-
'nose.plugins.0.10': [
235-
'KnownFailure = matplotlib.testing.noseclasses:KnownFailure'
236-
]
237-
},
238241
)

0 commit comments

Comments
 (0)