# HG changeset patch # User Jérémy Bobbio # Date 1560930698 -7200 # Node ID 853e73456d0f8b4d526e5b8f0263a86ae1ecffe9 # Parent 4b612e5b9d058fa09702c05611d8f1a9fa055eab [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 4b612e5b9d05 -r 853e73456d0f MANIFEST.in --- a/MANIFEST.in Wed Jun 26 12:35:25 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 4b612e5b9d05 -r 853e73456d0f cubicweb/skeleton/debian/changelog.tmpl --- a/cubicweb/skeleton/debian/changelog.tmpl Wed Jun 26 12:35:25 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 4b612e5b9d05 -r 853e73456d0f cubicweb/skeleton/debian/compat --- a/cubicweb/skeleton/debian/compat Wed Jun 26 12:35:25 2019 +0200 +++ b/cubicweb/skeleton/debian/compat Wed Jun 19 09:51:38 2019 +0200 @@ -1,1 +1,1 @@ -7 +9 diff -r 4b612e5b9d05 -r 853e73456d0f cubicweb/skeleton/debian/control.tmpl --- a/cubicweb/skeleton/debian/control.tmpl Wed Jun 26 12:35:25 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 4b612e5b9d05 -r 853e73456d0f 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 4b612e5b9d05 -r 853e73456d0f cubicweb/skeleton/debian/rules --- a/cubicweb/skeleton/debian/rules Wed Jun 26 12:35:25 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 4b612e5b9d05 -r 853e73456d0f 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 4b612e5b9d05 -r 853e73456d0f 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 4b612e5b9d05 -r 853e73456d0f 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 4b612e5b9d05 -r 853e73456d0f 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 4b612e5b9d05 -r 853e73456d0f 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