Package: python-netaddr
Version: 0.7.5-2
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu oneiric ubuntu-patch

In Ubuntu, the attached patch was applied to fix the test script to actually 
find the shipped tests.

The problem is that upstream's setup.py does not install the test data, so it 
only lives in the source directory.  So I changed runtests.py to look there 
instead of debian/python-netaddr.

Thanks for considering the patch.


-- System Information:
Debian Release: wheezy/sid
  APT prefers oneiric-updates
  APT policy: (500, 'oneiric-updates'), (500, 'oneiric-security'), (500, 
'oneiric')
Architecture: i386 (i686)

Kernel: Linux 3.0.0-4-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -u python-netaddr-0.7.5/debian/rules python-netaddr-0.7.5/debian/rules
--- python-netaddr-0.7.5/debian/rules
+++ python-netaddr-0.7.5/debian/rules
@@ -14,3 +14,3 @@
 	$(call cdbs_python_binary,python$(cdbs_python_compile_version)) \
-		debian/runtests.py debian/python-netaddr
+		debian/runtests.py .
 endif
diff -u python-netaddr-0.7.5/debian/runtests.py python-netaddr-0.7.5/debian/runtests.py
--- python-netaddr-0.7.5/debian/runtests.py
+++ python-netaddr-0.7.5/debian/runtests.py
@@ -1,18 +1,6 @@
 import sys
-from os.path import join, isdir
-from distutils.sysconfig import get_python_lib
-from site import addsitedir
 
-root = sys.argv.pop(1)
-site_packages = get_python_lib()
-
-_path = sys.path[:]
-sys.path[:] = []
-path = join(root, site_packages[1:])
-if not isdir(path):
-    path = join(root, site_packages.replace('/dist', '/site')[1:])
-addsitedir(path)
-sys.path.extend(_path)
+sys.path.insert(0, sys.argv.pop(1))
 
 import netaddr.tests
 netaddr.tests.run()

Reply via email to