[Python-modules-commits] r15054 - in packages/python-networkx/trunk/debian (3 files)

morph at users.alioth.debian.org morph at users.alioth.debian.org
Thu Dec 9 23:38:59 UTC 2010


    Date: Thursday, December 9, 2010 @ 23:38:58
  Author: morph
Revision: 15054

* debian/patches/70_set_matplotlib_ps_backend.patch
  - set matplotlib backend to 'PS', so a DISPLAY it's not required and the
    tests can be run in a "reduced" environment

Added:
  packages/python-networkx/trunk/debian/patches/70_set_matplotlib_ps_backend.patch
Modified:
  packages/python-networkx/trunk/debian/changelog
  packages/python-networkx/trunk/debian/patches/series

Modified: packages/python-networkx/trunk/debian/changelog
===================================================================
--- packages/python-networkx/trunk/debian/changelog	2010-12-09 01:01:59 UTC (rev 15053)
+++ packages/python-networkx/trunk/debian/changelog	2010-12-09 23:38:58 UTC (rev 15054)
@@ -30,8 +30,11 @@
     - upstream patch to restrict node boundary test cases to valid range
   * debian/patches/60_remove_svn_refs.diff
     - upstream patch to remove references to old SVN repository (now Mercurial)
+  * debian/patches/70_set_matplotlib_ps_backend.patch
+    - set matplotlib backend to 'PS', so a DISPLAY it's not required and the
+      tests can be run in a "reduced" environment
 
- -- Sandro Tosi <morph at debian.org>  Fri, 24 Sep 2010 00:42:27 +0200
+ -- Sandro Tosi <morph at debian.org>  Fri, 10 Dec 2010 00:38:06 +0100
 
 python-networkx (1.1-2) unstable; urgency=low
 

Added: packages/python-networkx/trunk/debian/patches/70_set_matplotlib_ps_backend.patch
===================================================================
--- packages/python-networkx/trunk/debian/patches/70_set_matplotlib_ps_backend.patch	                        (rev 0)
+++ packages/python-networkx/trunk/debian/patches/70_set_matplotlib_ps_backend.patch	2010-12-09 23:38:58 UTC (rev 15054)
@@ -0,0 +1,49 @@
+Description: set matplotlib backend to PS to handle case with no DISPLAY environment.
+
+Index: python-networkx-1.3/networkx/drawing/nx_pylab.py
+===================================================================
+--- python-networkx-1.3.orig/networkx/drawing/nx_pylab.py	2010-08-29 02:22:06.000000000 +0200
++++ python-networkx-1.3/networkx/drawing/nx_pylab.py	2010-12-10 00:22:46.200507018 +0100
+@@ -902,6 +902,8 @@
+ def setup_module(module):
+     from nose import SkipTest
+     try:
++        import matplotlib as mpl
++        mpl.use('PS')
+         import pylab
+     except:
+         raise SkipTest("matplotlib not available")
+Index: python-networkx-1.3/networkx/drawing/tests/test_pylab.py
+===================================================================
+--- python-networkx-1.3.orig/networkx/drawing/tests/test_pylab.py	2010-08-29 02:22:06.000000000 +0200
++++ python-networkx-1.3/networkx/drawing/tests/test_pylab.py	2010-12-10 00:22:33.035506548 +0100
+@@ -15,9 +15,13 @@
+     def setupClass(cls):
+         global pylab
+         try:
++            import matplotlib as mpl
++            mpl.use('PS')
+             import pylab
+         except ImportError:
+             raise SkipTest('matplotlib not available.')
++        except RuntimeError:
++            raise SkipTest('matplotlib not available.')
+ 
+     def setUp(self):
+         self.G=nx.barbell_graph(5,10)
+@@ -27,12 +31,11 @@
+ #         hold(False)
+         N=self.G
+         nx.draw_spring(N)
+-        pylab.savefig("test.png")
++        pylab.savefig("test.ps")
+         nx.draw_random(N)
+         pylab.savefig("test.ps")
+         nx.draw_circular(N)
+-        pylab.savefig("test.png")
++        pylab.savefig("test.ps")
+         nx.draw_spectral(N)
+-        pylab.savefig("test.png")
+-        os.unlink('test.png')
++        pylab.savefig("test.ps")
+         os.unlink('test.ps')

Modified: packages/python-networkx/trunk/debian/patches/series
===================================================================
--- packages/python-networkx/trunk/debian/patches/series	2010-12-09 01:01:59 UTC (rev 15053)
+++ packages/python-networkx/trunk/debian/patches/series	2010-12-09 23:38:58 UTC (rev 15054)
@@ -4,3 +4,4 @@
 40_add_networkxcss
 50_boundary-test-fix.patch
 60_remove_svn_refs.diff
+70_set_matplotlib_ps_backend.patch




More information about the Python-modules-commits mailing list