[PATCH 2 of 3 cubicweb update-skel-pkg] [skeleton] Update Debian packaging template

Jérémy Bobbio jeremy.bobbio at irq7.fr
Sun Jun 23 09:12:40 CEST 2019


# HG changeset patch
# User Jérémy Bobbio <jeremy.bobbio at irq7.fr>
# Date 1560930698 -7200
#      Wed Jun 19 09:51:38 2019 +0200
# Node ID 1ce09fce640946c1719ed66b8d9e8ab42416375e
# Parent  2ecebc8d87b7dd1c2003ad6c4e45d466fa37a4ad
# EXP-Topic update-skel-pkg
[skeleton] Update Debian packaging template

Here are multiple updates to the Debian packaging template provided when
running `cubicweb-ctl newcube`:

 * Switch to source format 3.0 (quilt).
 * Switch to debhelper 9.
 * Switch to dh-python.
 * Switch to Python 3.
 * Name the binary package `python3-cubicweb-CUBENAME` instead of
   just `cubicweb-CUBENAME` (which is still the source package).
 * Populate Depends using dh_python3 support for Python requirements.
 * Run test suite at build time using pytest.
 * Add autopkgtest to run test suite against the installed package.
 * Bump Standards-Version to 4.3.0.

diff -r 2ecebc8d87b7 -r 1ce09fce6409 MANIFEST.in
--- a/MANIFEST.in	Mon Jun 17 17:23:36 2019 +0200
+++ b/MANIFEST.in	Wed Jun 19 09:51:38 2019 +0200
@@ -77,6 +77,6 @@
 
 include cubicweb/web/data/jquery-treeview/*.md
 
-recursive-include cubicweb/skeleton *.py *.css *.js *.po compat *.tmpl rules
+recursive-include cubicweb/skeleton *.py *.css *.js *.po compat *.tmpl format options pytest control
 
 prune cubicweb/misc/cwfs
diff -r 2ecebc8d87b7 -r 1ce09fce6409 cubicweb/skeleton/debian/changelog.tmpl
--- a/cubicweb/skeleton/debian/changelog.tmpl	Mon Jun 17 17:23:36 2019 +0200
+++ b/cubicweb/skeleton/debian/changelog.tmpl	Wed Jun 19 09:51:38 2019 +0200
@@ -1,6 +1,6 @@
-%(distname)s (0.1.0-1) UNRELEASED; urgency=low
+%(distname)s (0.1.0-1) UNRELEASED; urgency=medium
 
-  * initial release
+  * Initial release.
 
  -- %(author)s <%(author-email)s>  %(rfc2822-date)s
 
diff -r 2ecebc8d87b7 -r 1ce09fce6409 cubicweb/skeleton/debian/compat
--- a/cubicweb/skeleton/debian/compat	Mon Jun 17 17:23:36 2019 +0200
+++ b/cubicweb/skeleton/debian/compat	Wed Jun 19 09:51:38 2019 +0200
@@ -1,1 +1,1 @@
-7
+9
diff -r 2ecebc8d87b7 -r 1ce09fce6409 cubicweb/skeleton/debian/control.tmpl
--- a/cubicweb/skeleton/debian/control.tmpl	Mon Jun 17 17:23:36 2019 +0200
+++ b/cubicweb/skeleton/debian/control.tmpl	Wed Jun 19 09:51:38 2019 +0200
@@ -3,19 +3,18 @@
 Priority: optional
 Maintainer: %(author)s <%(author-email)s>
 Build-Depends:
- debhelper (>= 7),
+ debhelper (>= 9),
  dh-python,
- python (>= 2.6.5),
- python-setuptools,
-Standards-Version: 3.9.3
-X-Python-Version: >= 2.6
+ python3-all,
+ python3-setuptools,
+ python3-pytest,
+Standards-Version: 4.3.0
+X-Python3-Version: >= 3.4
 
-Package: %(distname)s
+Package: python3-%(distname)s
 Architecture: all
 Depends:
- python-cubicweb (>= %(version)s),
- python-six (>= 1.4.0),
- ${python:Depends},
+ ${python3:Depends},
  ${misc:Depends},
 Description: %(shortdesc)s
  CubicWeb is a semantic web application framework.
diff -r 2ecebc8d87b7 -r 1ce09fce6409 cubicweb/skeleton/debian/pybuild.testfiles.tmpl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cubicweb/skeleton/debian/pybuild.testfiles.tmpl	Wed Jun 19 09:51:38 2019 +0200
@@ -0,0 +1,3 @@
+test
+tox.ini
+%(distname)s.egg-info
diff -r 2ecebc8d87b7 -r 1ce09fce6409 cubicweb/skeleton/debian/rules
--- a/cubicweb/skeleton/debian/rules	Mon Jun 17 17:23:36 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-#!/usr/bin/make -f
-
-%:
-	dh $@ --with python2
diff -r 2ecebc8d87b7 -r 1ce09fce6409 cubicweb/skeleton/debian/rules.tmpl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cubicweb/skeleton/debian/rules.tmpl	Wed Jun 19 09:51:38 2019 +0200
@@ -0,0 +1,7 @@
+#!/usr/bin/make -f
+
+export PYBUILD_NAME = %(distname)s
+export PYBUILD_OPTION = --test-pytest
+
+%%:
+	dh $@ --with python3 --buildsystem=pybuild
diff -r 2ecebc8d87b7 -r 1ce09fce6409 cubicweb/skeleton/debian/source/format
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cubicweb/skeleton/debian/source/format	Wed Jun 19 09:51:38 2019 +0200
@@ -0,0 +1,1 @@
+3.0 (quilt)
diff -r 2ecebc8d87b7 -r 1ce09fce6409 cubicweb/skeleton/debian/source/options
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cubicweb/skeleton/debian/source/options	Wed Jun 19 09:51:38 2019 +0200
@@ -0,0 +1,1 @@
+extend-diff-ignore = "^([^/]*\.spec$)"
diff -r 2ecebc8d87b7 -r 1ce09fce6409 cubicweb/skeleton/debian/tests/control
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cubicweb/skeleton/debian/tests/control	Wed Jun 19 09:51:38 2019 +0200
@@ -0,0 +1,9 @@
+Tests: pytest
+Depends:
+ @builddeps@,
+ # Uncomment  if the tests require database access
+ #python3-cubicweb-postgresql-support
+Restrictions:
+ allow-stderr,
+ # Uncomment if the tests require database access
+ #isolation-container,
diff -r 2ecebc8d87b7 -r 1ce09fce6409 cubicweb/skeleton/debian/tests/pytest
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cubicweb/skeleton/debian/tests/pytest	Wed Jun 19 09:51:38 2019 +0200
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+set -e
+set -x
+
+### Setup tests
+
+# Uncomment if tests require database access
+#service postgresql restart || service postgresql start
+#trap 'service postgresql stop' EXIT
+
+cp -r test tox.ini "$AUTOPKGTEST_TMP"
+chown -R nobody:nogroup "$AUTOPKGTEST_TMP"
+
+### Run tests
+
+for py in $(py3versions -r 2>/dev/null); do
+	cd "$AUTOPKGTEST_TMP"
+	echo "Testing with $py:"
+	su nobody --shell /bin/sh \
+		-c "$py -m pytest -v"
+done


More information about the cubicweb-devel mailing list