[PATCH yams] Update Debian packaging according to latest standards

Jérémy Bobbio jeremy.bobbio at irq7.fr
Tue Jun 4 18:53:14 CEST 2019


# HG changeset patch
# User Jérémy Bobbio <jeremy.bobbio at irq7.fr>
# Date 1559582787 -7200
#      Mon Jun 03 19:26:27 2019 +0200
# Node ID e168e10141272f247c30430ac5d0d827234d86fc
# Parent  bf0d4b8d477c8678d6ca2b67f90271b77efed94c
Update Debian packaging according to latest standards

Regarding packaging:

 - Use dh-python and trim debian/rules accordingly.
 - Update X-Python-Version to officially supported versions.
 - Run testsuite at build time.
 - Add superficial autopkgtest support using autodep8.
 - Add autopkgtest to run the testsuite against the installed
   packages.
 - Add Vcs-Hg and Vcs-Browser tags.
 - Bump Standards-Version to 4.3.0.

Also disable test suite with Python 3 as it is currently broken:
https://www.logilab.org/ticket/10132388

Stop shipping yams-view which is currently broken and depends
on cubicweb:
https://www.logilab.org/ticket/81266
https://www.logilab.org/ticket/9120

Stop shipping yams-check which is currently broken:
https://www.logilab.org/ticket/81261

diff -r bf0d4b8d477c -r e168e1014127 debian/changelog
--- a/debian/changelog	Tue May 28 15:18:04 2019 +0200
+++ b/debian/changelog	Mon Jun 03 19:26:27 2019 +0200
@@ -1,3 +1,25 @@
+yams (0.45.2-2) UNRELEASED; urgency=medium
+
+  * Update Debian packaging according to latest standards:
+    - Use dh-python and trim debian/rules accordingly.
+    - Update X-Python-Version to officially supported versions.
+    - Run testsuite at build time.
+    - Add superficial autopkgtest support using autodep8.
+    - Add autopkgtest to run the testsuite against the installed
+      packages.
+    - Add Vcs-Hg and Vcs-Browser tags.
+    - Bump Standards-Version to 4.3.0.
+  * Disable test suite with Python 3 as it is currently broken:
+    https://www.logilab.org/ticket/10132388
+  * Stop shipping yams-view which is currently broken and depends
+    on cubicweb:
+    https://www.logilab.org/ticket/81266
+    https://www.logilab.org/ticket/9120
+  * Stop shipping yams-check which is currently broken:
+    https://www.logilab.org/ticket/81261
+
+ -- Jérémy Bobbio <jeremy.bobbio at irq7.fr>  Mon, 03 Jun 2019 18:46:44 +0200
+
 yams (0.45.2-1) unstable; urgency=medium
 
   * New upstream release.
diff -r bf0d4b8d477c -r e168e1014127 debian/control
--- a/debian/control	Tue May 28 15:18:04 2019 +0200
+++ b/debian/control	Mon Jun 03 19:26:27 2019 +0200
@@ -6,24 +6,28 @@
     Nicolas Chauvat <nicolas.chauvat at logilab.fr>
 Build-Depends:
  debhelper (>= 9),
- python-all (>= 2.6.5),
+ dh-python,
+ python-all,
  python3-all,
  python-logilab-common (>= 1.4.0),
  python-logilab-database (>= 1.11),
  python-six (>= 1.4.0),
  python-setuptools,
  python-pytest,
-# for python 2.6
+# for python 2.7
  python-unittest2,
  python3-logilab-common (>= 1.4.0) | python3 (<< 3.3),
  python3-logilab-database (>= 1.11) | python3 (<< 3.3),
  python3-six (>= 1.4.0) | python3 (<< 3.3),
  python3-setuptools | python3 (<< 3.3),
  python3-pytest,
+Testsuite: autopkgtest-pkg-python
 Homepage: http://www.logilab.org/project/yams
-Standards-Version: 3.8.0
-X-Python-Version: >= 2.6
-X-Python3-Version: >= 3.3
+Vcs-Hg: https://hg.logilab.org/master/yams
+Vcs-Browser: https://hg.logilab.org/master/yams
+Standards-Version: 4.3.0
+X-Python-Version: >= 2.7
+X-Python3-Version: >= 3.4
 
 Package: python-yams
 Architecture: all
diff -r bf0d4b8d477c -r e168e1014127 debian/pybuild.testfiles
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/pybuild.testfiles	Mon Jun 03 19:26:27 2019 +0200
@@ -0,0 +1,3 @@
+test
+tox.ini
+yams.egg-info
diff -r bf0d4b8d477c -r e168e1014127 debian/python-yams.install
--- a/debian/python-yams.install	Tue May 28 15:18:04 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-usr/bin
-usr/lib/python2*
diff -r bf0d4b8d477c -r e168e1014127 debian/python3-yams.install
--- a/debian/python3-yams.install	Tue May 28 15:18:04 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-usr/lib/python3*
diff -r bf0d4b8d477c -r e168e1014127 debian/rules
--- a/debian/rules	Tue May 28 15:18:04 2019 +0200
+++ b/debian/rules	Mon Jun 03 19:26:27 2019 +0200
@@ -1,50 +1,16 @@
 #!/usr/bin/make -f
-# Sample debian/rules that uses debhelper.
-# GNU copyright 1997 to 1999 by Joey Hess.
-#
-# adapted by Logilab for automatic generation by debianize
-# (part of the devtools project, http://www.logilab.org/projects/devtools)
-#
-# Copyright (c) 2003-2005 LOGILAB S.A. (Paris, FRANCE).
-# http://www.logilab.fr/ -- mailto:contact at logilab.fr
-
-include /usr/share/python/python.mk
-
-# don't build the python3 package if python3 is < 3.3
-py3k = $(subst python3.,,$(shell py3versions -d))
-build_py3k = $(shell test "$(py3k)" -gt 2 && echo 1)
 
-ifeq (,$(build_py3k))
-    DH_OPTIONS += -Npython3-yams
-    export DH_OPTIONS
-    addons = python2
-else
-    addons = python2,python3
-endif
-
-export NO_SETUPTOOLS=1
-
-override_dh_auto_clean:
-	dh_auto_clean
-	rm -rf yams.egg-info
-	rm -rf build
+export PYBUILD_NAME = yams
 
-install-python%:
-	python$* setup.py -q install --no-compile --root=$(CURDIR)/debian/tmp \
-	    $(py_setup_install_args)
-
-override_dh_auto_install: $(patsubst %,install-%,$(shell py3versions -r))
-	dh_auto_install
-
-test-python%:
-	python$* setup.py egg_info
-	PYTHONPATH=$(CURDIR) python$* -m pytest test
-
-ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-override_dh_auto_test: $(patsubst %,test-%,$(shell pyversions -r))
-override_dh_auto_test: $(patsubst %,test-%,$(shell py3versions -r))
-endif
+# Tests on Python 3 currently have issues
+export PYBUILD_DISABLE_python3.7 = test
 
 %:
-	dh $@ --with $(addons)
+	dh $@ --with python2,python3 --buildsystem=pybuild
 
+override_dh_auto_install:
+	dh_auto_install
+	# Remove binaries from Python 2 package
+	rm -rf debian/python-yams/usr/bin
+	# Remove binaries from Python 3 package
+	rm -rf debian/python3-yams/usr/bin
diff -r bf0d4b8d477c -r e168e1014127 debian/source/format
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/source/format	Mon Jun 03 19:26:27 2019 +0200
@@ -0,0 +1,1 @@
+3.0 (quilt)
diff -r bf0d4b8d477c -r e168e1014127 debian/source/options
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/source/options	Mon Jun 03 19:26:27 2019 +0200
@@ -0,0 +1,1 @@
+extend-diff-ignore = "^(.hg(/|ignore$|tags$)|[^/]*\.spec$|tox.ini$)"
diff -r bf0d4b8d477c -r e168e1014127 debian/tests/control
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/tests/control	Mon Jun 03 19:26:27 2019 +0200
@@ -0,0 +1,4 @@
+Tests: unittest
+Depends:
+ @, @builddeps@,
+Restrictions: allow-stderr
diff -r bf0d4b8d477c -r e168e1014127 debian/tests/unittest
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/tests/unittest	Mon Jun 03 19:26:27 2019 +0200
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+set -x
+
+### Setup tests
+
+cp -r test tox.ini "$AUTOPKGTEST_TMP"
+
+### Run tests
+
+for py in $(pyversions -r 2>/dev/null) $(py3versions -r 2>/dev/null); do
+	echo "Testing with $py:"
+	(cd "$AUTOPKGTEST_TMP" && $py -m pytest test)
+done


More information about the cubicweb-devel mailing list