commit:     e87319182c93cb6b8052275993e6a67cac9bc224
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 21 10:00:30 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Wed Oct 21 13:40:24 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e8731918

dev-python/matplotlib: Backported test fix

Package-Manager: portage-2.2.23
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 .../matplotlib-1.4.3-backport-GH5291-2462.patch    | 126 +++++++++++++++++++++
 dev-python/matplotlib/matplotlib-1.4.3.ebuild      |   4 +
 dev-python/matplotlib/matplotlib-9999.ebuild       |   1 +
 3 files changed, 131 insertions(+)

diff --git 
a/dev-python/matplotlib/files/matplotlib-1.4.3-backport-GH5291-2462.patch 
b/dev-python/matplotlib/files/matplotlib-1.4.3-backport-GH5291-2462.patch
new file mode 100644
index 0000000..d6b2ae8
--- /dev/null
+++ b/dev-python/matplotlib/files/matplotlib-1.4.3-backport-GH5291-2462.patch
@@ -0,0 +1,126 @@
+commit f98c4846dc3c15b3d24aafb973764cb9b860d935
+Author: Thomas A Caswell <[email protected]>
+Date:   Sat Jan 10 16:10:29 2015 -0500
+
+    MNT : removed deprecated method/kwargs from patheffects
+    
+    Deprecated in #2462 / 84e0063bd37c629f129d36c548e8ce3a30692cae
+    
+    attn @pelson had to known-fail a test which was using the
+    proxy renderer to verify that PathEffectRender was working
+    correctly.
+
+diff --git a/lib/matplotlib/patheffects.py b/lib/matplotlib/patheffects.py
+index 13f8ce0..19e1c4a 100644
+--- a/lib/matplotlib/patheffects.py
++++ b/lib/matplotlib/patheffects.py
+@@ -10,9 +10,7 @@ from __future__ import (absolute_import, division, 
print_function,
+ import six
+ 
+ from matplotlib.backend_bases import RendererBase
+-from matplotlib.backends.backend_mixed import MixedModeRenderer
+ import matplotlib.transforms as mtransforms
+-import matplotlib.cbook as cbook
+ from matplotlib.colors import colorConverter
+ import matplotlib.patches as mpatches
+ 
+@@ -42,12 +40,6 @@ class AbstractPathEffect(object):
+         return transform + self._offset_trans.clear().translate(offset_x,
+                                                                 offset_y)
+ 
+-    def get_proxy_renderer(self, renderer):
+-        """Return a PathEffectRenderer instance for this PathEffect."""
+-        cbook.deprecated('v1.4', name='get_proxy_renderer',
+-                         alternative='PathEffectRenderer')
+-        return PathEffectRenderer([self], renderer)
+-
+     def _update_gc(self, gc, new_gc_dict):
+         """
+         Update the given GraphicsCollection with the given
+@@ -219,9 +211,9 @@ class withStroke(Stroke):
+ 
+ class SimplePatchShadow(AbstractPathEffect):
+     """A simple shadow via a filled patch."""
+-    def __init__(self, offset=(2,-2),
+-                 shadow_rgbFace=None, alpha=None, patch_alpha=None,
+-                 rho=0.3, offset_xy=None, **kwargs):
++    def __init__(self, offset=(2, -2),
++                 shadow_rgbFace=None, alpha=None,
++                 rho=0.3, **kwargs):
+         """
+         Parameters
+         ----------
+@@ -241,24 +233,12 @@ class SimplePatchShadow(AbstractPathEffect):
+             :meth:`AbstractPathEffect._update_gc`.
+ 
+         """
+-        if offset_xy is not None:
+-            cbook.deprecated('v1.4', 'The offset_xy keyword is deprecated. '
+-                             'Use the offset keyword instead.')
+-            offset = offset_xy
+         super(SimplePatchShadow, self).__init__(offset)
+ 
+         if shadow_rgbFace is None:
+             self._shadow_rgbFace = shadow_rgbFace
+         else:
+             self._shadow_rgbFace = colorConverter.to_rgba(shadow_rgbFace)
+-        if patch_alpha is not None:
+-            cbook.deprecated('v1.4', 'The patch_alpha keyword is deprecated. '
+-                             'Use the alpha keyword instead. Transform your '
+-                             'patch_alpha by alpha = 1 - patch_alpha')
+-            if alpha is not None:
+-                raise ValueError("Both alpha and patch_alpha were set. "
+-                                 "Just use alpha.")
+-            alpha = 1 - patch_alpha
+ 
+         if alpha is None:
+             alpha = 0.3
+diff --git a/lib/matplotlib/tests/test_patheffects.py 
b/lib/matplotlib/tests/test_patheffects.py
+index 8298ceb..5af71e5 100644
+--- a/lib/matplotlib/tests/test_patheffects.py
++++ b/lib/matplotlib/tests/test_patheffects.py
+@@ -5,7 +5,8 @@ import six
+ 
+ import numpy as np
+ 
+-from matplotlib.testing.decorators import image_comparison, cleanup
++from matplotlib.testing.decorators import (image_comparison, cleanup,
++                                           knownfailureif)
+ import matplotlib.pyplot as plt
+ import matplotlib.patheffects as path_effects
+ 
+@@ -84,19 +85,7 @@ def test_patheffect3():
+ 
+ 
+ @cleanup
+-def test_PathEffect_get_proxy():
+-    pe = path_effects.AbstractPathEffect()
+-    fig = plt.gcf()
+-    renderer = fig.canvas.get_renderer()
+-
+-    with mock.patch('matplotlib.cbook.deprecated') as dep:
+-        proxy_renderer = pe.get_proxy_renderer(renderer)
+-    assert_equal(proxy_renderer._renderer, renderer)
+-    assert_equal(proxy_renderer._path_effects, [pe])
+-    dep.assert_called()
+-
+-
+-@cleanup
++@knownfailureif(True)
+ def test_PathEffect_points_to_pixels():
+     fig = plt.figure(dpi=150)
+     p1, = plt.plot(range(10))
+@@ -116,11 +105,9 @@ def test_PathEffect_points_to_pixels():
+                  pe_renderer.points_to_pixels(15))
+ 
+ 
+-def test_SimplePatchShadow_offset_xy():
+-    with mock.patch('matplotlib.cbook.deprecated') as dep:
+-        pe = path_effects.SimplePatchShadow(offset_xy=(4, 5))
++def test_SimplePatchShadow_offset():
++    pe = path_effects.SimplePatchShadow(offset=(4, 5))
+     assert_equal(pe._offset, (4, 5))
+-    dep.assert_called()
+ 
+ 
+ @image_comparison(baseline_images=['collection'])

diff --git a/dev-python/matplotlib/matplotlib-1.4.3.ebuild 
b/dev-python/matplotlib/matplotlib-1.4.3.ebuild
index 78303eb..bf6eb50 100644
--- a/dev-python/matplotlib/matplotlib-1.4.3.ebuild
+++ b/dev-python/matplotlib/matplotlib-1.4.3.ebuild
@@ -126,6 +126,10 @@ use_setup() {
        fi
 }
 
+PATCHES=(
+       "${FILESDIR}"/${P}-backport-GH5291-2462.patch
+)
+
 python_prepare_all() {
 # Generates test failures, but fedora does it
 #      local PATCHES=(

diff --git a/dev-python/matplotlib/matplotlib-9999.ebuild 
b/dev-python/matplotlib/matplotlib-9999.ebuild
index 7fd7da9..64665e7 100644
--- a/dev-python/matplotlib/matplotlib-9999.ebuild
+++ b/dev-python/matplotlib/matplotlib-9999.ebuild
@@ -39,6 +39,7 @@ REQUIRED_USE="
 # #456704 -- a lot of py2-only deps
 PY2_USEDEP=$(python_gen_usedep python2_7)
 COMMON_DEPEND="
+       dev-python/cycler[${PYTHON_USEDEP}]
        >=dev-python/numpy-1.6[${PYTHON_USEDEP}]
        dev-python/python-dateutil:0[${PYTHON_USEDEP}]
        dev-python/pytz[${PYTHON_USEDEP}]

Reply via email to