[Python-modules-commits] r13448 - in packages/python-txosc/trunk/debian (rules runtrial.py)

alexandrequessy-guest at users.alioth.debian.org alexandrequessy-guest at users.alioth.debian.org
Wed Jun 16 14:03:27 UTC 2010


    Date: Wednesday, June 16, 2010 @ 14:03:20
  Author: alexandrequessy-guest
Revision: 13448

added runtrial.py to run test suites

Added:
  packages/python-txosc/trunk/debian/runtrial.py
Modified:
  packages/python-txosc/trunk/debian/rules

Modified: packages/python-txosc/trunk/debian/rules
===================================================================
--- packages/python-txosc/trunk/debian/rules	2010-06-16 13:31:11 UTC (rev 13447)
+++ packages/python-txosc/trunk/debian/rules	2010-06-16 14:03:20 UTC (rev 13448)
@@ -7,3 +7,11 @@
 
 binary-install/python-txosc::
 	dh_pysupport -ppython-txosc
+
+PKGDIR=debian/python-txosc/
+
+install/python-txosc::
+ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+	$(call cdbs_python_binary,python$(cdbs_python_compile_version)) debian/runtrial.py $(PKGDIR) txosc
+endif
+	find $(PKGDIR) -name dropin.cache -delete

Added: packages/python-txosc/trunk/debian/runtrial.py
===================================================================
--- packages/python-txosc/trunk/debian/runtrial.py	                        (rev 0)
+++ packages/python-txosc/trunk/debian/runtrial.py	2010-06-16 14:03:20 UTC (rev 13448)
@@ -0,0 +1,21 @@
+import sys
+import os
+from os.path import join
+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[:] = []
+addsitedir(join(root, site_packages[1:]))
+addsitedir(join(root, site_packages[1:].replace('dist-packages', 'site-packages'))) # cdbs installs python modules in site-packages even for Python 2.6
+sys.path.extend(_path)
+
+# Some tests need PYTHONPATH. We provide a sensible value for it (although not really correct)
+if 'PYTHONPATH' not in os.environ:
+    os.environ['PYTHONPATH'] = os.pathsep.join(sys.path)
+
+from twisted.scripts.trial import run
+run()




More information about the Python-modules-commits mailing list