[Python-modules-commits] r25434 - in packages/python-cffi/trunk/debian (6 files)

stefanor at users.alioth.debian.org stefanor at users.alioth.debian.org
Wed Aug 7 22:33:15 UTC 2013


    Date: Wednesday, August 7, 2013 @ 22:33:13
  Author: stefanor
Revision: 25434

* Build with pybuild.
* Use -m pytest in autopkgtests.

Modified:
  packages/python-cffi/trunk/debian/changelog
  packages/python-cffi/trunk/debian/control
  packages/python-cffi/trunk/debian/rules
  packages/python-cffi/trunk/debian/tests/control
  packages/python-cffi/trunk/debian/tests/unittests
  packages/python-cffi/trunk/debian/tests/unittests3

Modified: packages/python-cffi/trunk/debian/changelog
===================================================================
--- packages/python-cffi/trunk/debian/changelog	2013-08-07 18:47:42 UTC (rev 25433)
+++ packages/python-cffi/trunk/debian/changelog	2013-08-07 22:33:13 UTC (rev 25434)
@@ -3,6 +3,8 @@
   [ Stefano Rivera ]
   * New upstream release.
   * Switched watch file to https.
+  * Build with pybuild.
+  * Use -m pytest in autopkgtests.
 
   [ Jakub Wilk ]
   * Use canonical URIs for Vcs-* fields.

Modified: packages/python-cffi/trunk/debian/control
===================================================================
--- packages/python-cffi/trunk/debian/control	2013-08-07 18:47:42 UTC (rev 25433)
+++ packages/python-cffi/trunk/debian/control	2013-08-07 22:33:13 UTC (rev 25434)
@@ -5,6 +5,7 @@
 Uploaders: Stefano Rivera <stefanor at debian.org>
 Build-Depends:
  debhelper (>= 9),
+ dh-python,
  libffi-dev,
  python-all-dbg,
  python-all-dev (>= 2.6.6-3~),

Modified: packages/python-cffi/trunk/debian/rules
===================================================================
--- packages/python-cffi/trunk/debian/rules	2013-08-07 18:47:42 UTC (rev 25433)
+++ packages/python-cffi/trunk/debian/rules	2013-08-07 22:33:13 UTC (rev 25434)
@@ -1,56 +1,23 @@
 #!/usr/bin/make -f
 
-PYVERS = $(shell pyversions -vr)
-PY3VERS = $(shell py3versions -vr)
+export PYBUILD_DESTDIR_python2=debian/python-cffi/
+export PYBUILD_DESTDIR_python2-dbg=debian/python-cffi-dbg/
+export PYBUILD_DESTDIR_python3=debian/python3-cffi/
+export PYBUILD_DESTDIR_python3-dbg=debian/python3-cffi-dbg/
 
-# For py_builddir_sh
-include /usr/share/python/python.mk
-
 %:
-	dh $@ --with python2,python3
+	dh $@ --with python2,python3 --buildsystem pybuild
 
-override_dh_auto_build:
-	set -e -x; \
-	for py in $(PYVERS) $(PY3VERS); do \
-		python$$py setup.py build; \
-		python$$py-dbg setup.py build; \
-	done
-
 override_dh_auto_test:
-ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-	set -ex; \
-	export TMPDIR=$(CURDIR)/build/tmp; \
-	mkdir "$$TMPDIR"; \
-	for py in $(PYVERS) $(PY3VERS); do \
-		PYTHONPATH=$(call py_builddir_sh,$$py) py.test-$$py c/ testing/; \
-		PYTHONPATH=$(call py_builddir_sh,$$py-dbg) python$$py-dbg $(shell which py.test) c/ testing/; \
-	done
-endif
+	PYBUILD_SYSTEM=custom \
+		PYBUILD_TEST_ARGS="{interpreter} -m pytest c/ testing/" \
+		dh_auto_test
 
-override_dh_auto_install:
-	set -e -x; \
-	for py in $(PYVERS); do \
-		python$$py setup.py install --skip-build --root debian/python-cffi --install-layout=deb; \
-		python$$py-dbg setup.py install --skip-build --root debian/python-cffi-dbg --install-layout=deb; \
-	done
-	set -e -x; \
-	for py in $(PY3VERS); do \
-		python$$py setup.py install --skip-build --root debian/python3-cffi --install-layout=deb; \
-		python$$py-dbg setup.py install --skip-build --root debian/python3-cffi-dbg --install-layout=deb; \
-	done
-	find debian/python3-cffi-dbg -type d -empty -delete
-
-override_dh_auto_clean:
-	rm -rf build
-	find . -name '*.pyc' -delete
-	find . -path '*/__pycache__/*' -delete
-	rm -rf $(wildcard testing/snippets/*/dist testing/snippets/*/build testing/snippets/*/*.egg-info)
-
 override_dh_strip:
-	dh_strip -p python-cffi --dbg-package=python-cffi-dbg
-	dh_strip -p python3-cffi --dbg-package=python3-cffi-dbg
+	dh_strip -p python-cffi -p python-cffi-dbg --dbg-package=python-cffi-dbg
+	dh_strip -p python3-cffi -p python3-cffi-dbg --dbg-package=python3-cffi-dbg
 	dh_strip --remaining-packages
 
 override_dh_clean:
 	dh_clean
-	rm -rf __pycache__
+	rm -rf $(wildcard testing/snippets/*/build testing/snippets/*/dist testing/snippets/*/*.egg-info)

Modified: packages/python-cffi/trunk/debian/tests/control
===================================================================
--- packages/python-cffi/trunk/debian/tests/control	2013-08-07 18:47:42 UTC (rev 25433)
+++ packages/python-cffi/trunk/debian/tests/control	2013-08-07 22:33:13 UTC (rev 25434)
@@ -1,5 +1,19 @@
 Tests: unittests
-Depends: python-all-dbg, python-all-dev, python-cffi, python-cffi-dbg, python-py, python-pytest, python-virtualenv
+Depends:
+ python-all-dbg,
+ python-all-dev,
+ python-cffi,
+ python-cffi-dbg,
+ python-py,
+ python-pytest,
+ python-virtualenv
 
 Tests: unittests3
-Depends: python-virtualenv, python3-all-dbg, python3-all-dev, python3-cffi, python3-cffi-dbg, python3-py, python3-pytest
+Depends:
+ python-virtualenv,
+ python3-all-dbg,
+ python3-all-dev,
+ python3-cffi,
+ python3-cffi-dbg,
+ python3-py,
+ python3-pytest

Modified: packages/python-cffi/trunk/debian/tests/unittests
===================================================================
--- packages/python-cffi/trunk/debian/tests/unittests	2013-08-07 18:47:42 UTC (rev 25433)
+++ packages/python-cffi/trunk/debian/tests/unittests	2013-08-07 22:33:13 UTC (rev 25434)
@@ -1,14 +1,19 @@
 #!/bin/sh
 set -efu
 
-pythons="$(pyversions -rv)"
+pythons="$(pyversions -r)"
 cp -a c testing "$ADTTMP"
 
 # Not appropriate:
 rm "$ADTTMP"/testing/test_version.py
 
+# Delete any stale __pycache__s
+find "$ADTTMP" -name '__pycache__' -print0 | xargs -0 rm -rf
+
 cd "$ADTTMP"
 for py in $pythons; do
-	py.test-$py c testing
-	python$py-dbg /usr/bin/py.test c testing 2>&1
+	echo "======= $py ======="
+	$py -m pytest c testing
+	echo "======= $py-dbg ======="
+	$py-dbg -m pytest c testing 2>&1
 done

Modified: packages/python-cffi/trunk/debian/tests/unittests3
===================================================================
--- packages/python-cffi/trunk/debian/tests/unittests3	2013-08-07 18:47:42 UTC (rev 25433)
+++ packages/python-cffi/trunk/debian/tests/unittests3	2013-08-07 22:33:13 UTC (rev 25434)
@@ -1,14 +1,19 @@
 #!/bin/sh
 set -efu
 
-pythons="$(py3versions -rv)"
+pythons="$(py3versions -r)"
 cp -a c testing "$ADTTMP"
 
 # Not appropriate:
 rm "$ADTTMP"/testing/test_version.py
 
+# Delete any stale __pycache__s
+find "$ADTTMP" -name '__pycache__' -print0 | xargs -0 rm -rf
+
 cd "$ADTTMP"
 for py in $pythons; do
-	py.test-$py c testing
-	python$py-dbg /usr/bin/py.test c testing 2>&1
+	echo "======= $py ======="
+	$py -m pytest c testing
+	echo "======= $py-dbg ======="
+	$py-dbg -m pytest c testing 2>&1
 done




More information about the Python-modules-commits mailing list