[Python-modules-commits] r30968 - in packages/python-pygraphviz/trunk/debian (5 files)

morph at users.alioth.debian.org morph at users.alioth.debian.org
Thu Oct 9 21:17:25 UTC 2014


    Date: Thursday, October 9, 2014 @ 21:17:25
  Author: morph
Revision: 30968

partial work to run unittests at build-time, but wont hold release any further

Added:
  packages/python-pygraphviz/trunk/debian/patches/2e27964ce86e8f49c496e5a549237ff6b1763e9a-2.patch
  packages/python-pygraphviz/trunk/debian/patches/2e27964ce86e8f49c496e5a549237ff6b1763e9a.patch
Modified:
  packages/python-pygraphviz/trunk/debian/changelog
  packages/python-pygraphviz/trunk/debian/patches/series
  packages/python-pygraphviz/trunk/debian/rules

Modified: packages/python-pygraphviz/trunk/debian/changelog
===================================================================
--- packages/python-pygraphviz/trunk/debian/changelog	2014-10-09 17:18:28 UTC (rev 30967)
+++ packages/python-pygraphviz/trunk/debian/changelog	2014-10-09 21:17:25 UTC (rev 30968)
@@ -12,8 +12,6 @@
     - bump Standards-Version to 3.9.6 (no changes needed)
   * debian/README.source
     - removed, no longer needed
-  * debian/rules
-    - run tests at build time
   * Bump debhelper compat version to 9
   * debian/copyright
     - extend packaging and upstream copyright years

Added: packages/python-pygraphviz/trunk/debian/patches/2e27964ce86e8f49c496e5a549237ff6b1763e9a-2.patch
===================================================================
--- packages/python-pygraphviz/trunk/debian/patches/2e27964ce86e8f49c496e5a549237ff6b1763e9a-2.patch	                        (rev 0)
+++ packages/python-pygraphviz/trunk/debian/patches/2e27964ce86e8f49c496e5a549237ff6b1763e9a-2.patch	2014-10-09 21:17:25 UTC (rev 30968)
@@ -0,0 +1,54 @@
+From 5cf3ff125226ddbf2edfad9d3c0d6ea2d59618ce Mon Sep 17 00:00:00 2001
+From: Aric Hagberg <aric.hagberg at gmail.com>
+Date: Sun, 21 Sep 2014 15:50:43 -0600
+Subject: [PATCH 2/2] add missing file
+
+---
+ pygraphviz/tests/test.py | 38 ++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 38 insertions(+)
+ create mode 100644 pygraphviz/tests/test.py
+
+diff --git a/pygraphviz/tests/test.py b/pygraphviz/tests/test.py
+new file mode 100644
+index 0000000..96817db
+--- /dev/null
++++ b/pygraphviz/tests/test.py
+@@ -0,0 +1,38 @@
++#!/usr/bin/env python
++import sys
++from os import path,getcwd
++
++def run(verbosity=1,doctest=False,numpy=True):
++    """Run PyGraphviz tests.
++
++    Parameters
++    ----------
++    verbosity: integer, optional
++      Level of detail in test reports.  Higher numbers provide  more detail.
++
++    doctest: bool, optional
++      True to run doctests in code modules
++    """
++    try:
++        import nose
++    except ImportError:
++        raise ImportError(\
++            "The nose package is needed to run the tests.")
++
++    sys.stderr.write("Running PyGraphiz tests:")
++    nx_install_dir=path.join(path.dirname(__file__), path.pardir)
++    # stop if running from source directory
++    if getcwd() == path.abspath(path.join(nx_install_dir,path.pardir)):
++        raise RuntimeError("Can't run tests from source directory.\n"
++                           "Run 'nosetests' from the command line.")
++
++    argv=[' ','--verbosity=%d'%verbosity,
++          '-w',nx_install_dir,
++          '-exe']
++    if doctest:
++        argv.extend(['--with-doctest','--doctest-extension=txt'])
++    nose.run(argv=argv)
++
++if __name__=="__main__":
++    run()
++

Added: packages/python-pygraphviz/trunk/debian/patches/2e27964ce86e8f49c496e5a549237ff6b1763e9a.patch
===================================================================
--- packages/python-pygraphviz/trunk/debian/patches/2e27964ce86e8f49c496e5a549237ff6b1763e9a.patch	                        (rev 0)
+++ packages/python-pygraphviz/trunk/debian/patches/2e27964ce86e8f49c496e5a549237ff6b1763e9a.patch	2014-10-09 21:17:25 UTC (rev 30968)
@@ -0,0 +1,87 @@
+From b0e480e64125cd2893b49be33a4077a6ede4c1d3 Mon Sep 17 00:00:00 2001
+From: Aric Hagberg <aric.hagberg at gmail.com>
+Date: Sun, 21 Sep 2014 15:07:56 -0600
+
+Fixes #24
+---
+ pygraphviz/__init__.py           | 3 +--
+ pygraphviz/tests/__init__.py     | 8 --------
+ pygraphviz/tests/test_unicode.py | 5 ++++-
+ setup.py                         | 5 ++---
+ setup_egg.py                     | 4 ++--
+ 5 files changed, 9 insertions(+), 16 deletions(-)
+
+diff --git a/pygraphviz/__init__.py b/pygraphviz/__init__.py
+index a099307..68b72b2 100644
+--- a/pygraphviz/__init__.py
++++ b/pygraphviz/__init__.py
+@@ -72,5 +72,4 @@ def version():
+     neato=_get_prog('neato')
+     os.system(neato+' -V')
+ 
+-# import tests: run as pygraphviz.test()
+-# from .tests import run as test
++from pygraphviz.tests.test import run as test
+diff --git a/pygraphviz/tests/__init__.py b/pygraphviz/tests/__init__.py
+index 02d64ad..e69de29 100644
+--- a/pygraphviz/tests/__init__.py
++++ b/pygraphviz/tests/__init__.py
+@@ -1,8 +0,0 @@
+-import unittest
+-
+-def run():
+-    """Runs the testsuite as command line application."""
+-    try:
+-        unittest.main(testLoader=BetterLoader(), defaultTest='suite')
+-    except Exception as e:
+-        print('Error: %s' % e)
+diff --git a/pygraphviz/tests/test_unicode.py b/pygraphviz/tests/test_unicode.py
+index 486fbeb..68f320a 100644
+--- a/pygraphviz/tests/test_unicode.py
++++ b/pygraphviz/tests/test_unicode.py
+@@ -2,7 +2,10 @@
+ from __future__ import unicode_literals
+ from nose.tools import *
+ import pygraphviz as pgv
+-from pygraphviz.agraph import _TEXT_TYPE
++import sys
++_PY2 = sys.version_info[0] == 2
++_TEXT_TYPE = unicode if _PY2 else str
++
+ 
+ def test_name_unicode():
+     A = pgv.AGraph(name='unicode')
+diff --git a/setup.py b/setup.py
+index a81d754..235307d 100644
+--- a/setup.py
++++ b/setup.py
+@@ -20,8 +20,8 @@
+     print("To install, run 'python setup.py install'")
+     print()
+ 
+-if sys.version_info[:2] < (2, 4):
+-    print("PyGraphviz requires Python version 2.4 or later (%d.%d detected)." % \
++if sys.version_info[:2] < (2, 6):
++    print("PyGraphviz requires Python version 2.6 or later (%d.%d detected)." % \
+           sys.version_info[:2])
+     sys.exit(-1)
+ 
+@@ -151,4 +151,3 @@
+         ext_modules=extension,
+         package_data=package_data
+     )
+-
+diff --git a/setup_egg.py b/setup_egg.py
+index 5bc313a..9ac9421 100755
+--- a/setup_egg.py
++++ b/setup_egg.py
+@@ -54,8 +54,8 @@
+         data_files       = data,
+         ext_modules      = extension,
+         package_data     = package_data,
+-        install_requires=['setuptools'],
+         include_package_data = True,
+-        test_suite       = "pygraphviz.tests.test.test_suite", 
++        test_suite       = 'nose.collector',
++        tests_require    = ['nose>=0.10.1'],
+         )

Modified: packages/python-pygraphviz/trunk/debian/patches/series
===================================================================
--- packages/python-pygraphviz/trunk/debian/patches/series	2014-10-09 17:18:28 UTC (rev 30967)
+++ packages/python-pygraphviz/trunk/debian/patches/series	2014-10-09 21:17:25 UTC (rev 30968)
@@ -1 +1,3 @@
 dont_install_data.patch
+2e27964ce86e8f49c496e5a549237ff6b1763e9a.patch
+2e27964ce86e8f49c496e5a549237ff6b1763e9a-2.patch

Modified: packages/python-pygraphviz/trunk/debian/rules
===================================================================
--- packages/python-pygraphviz/trunk/debian/rules	2014-10-09 17:18:28 UTC (rev 30967)
+++ packages/python-pygraphviz/trunk/debian/rules	2014-10-09 21:17:25 UTC (rev 30968)
@@ -24,12 +24,16 @@
 	dh_installdocs --link-doc=python-pygraphviz
 
 override_dh_auto_test:
-ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
-	set -e; \
-	for python in $(PYTHON2); do \
-		LIB=$$($$python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_purelib)") ; \
-		PYTHONPATH=$$LIB $$python pygraphviz/tests/test.py ; \
-		LIB=$$($$python-dbg -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_purelib)") ; \
-		PYTHONPATH=$$LIB $$python-dbg pygraphviz/tests/test.py ; \
-	done
-endif
+#ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
+#	set -e; \
+#	for python in $(PYTHON2); do \
+#		LIB=$$($$python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_purelib)") ; \
+#		touch $(CURDIR)/$$LIB/pygraphviz/tests/__init__py ; \
+#		cd build ; $$python -c "import sys ; sys.path.insert(0, '$(CURDIR)/$$LIB') ; import pygraphviz as t ; t.test()" ; cd .. ; \
+#		rm $(CURDIR)/$$LIB/pygraphviz/tests/__init__py ; \
+#		LIB=$$($$python-dbg -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_purelib)") ; \
+#		touch $(CURDIR)/$$LIB/pygraphviz/tests/__init__py ; \
+#		cd build ; $$python-dbg -c "import sys ; sys.path.insert(0, '$(CURDIR)/$$LIB') ; import pygraphviz as t ; t.test()" ; cd .. ; \
+#		rm $(CURDIR)/$$LIB/pygraphviz/tests/__init__py ; \
+#	done
+#endif




More information about the Python-modules-commits mailing list