Update Debian packaging with support for Python 3
authorJérémy Bobbio <jeremy.bobbio@irq7.fr>
Thu, 21 Nov 2019 17:05:13 +0100
changeset 390 c0a9c7b7a31e
parent 389 7f196b516c83
child 391 8059a2b88d3e
Update Debian packaging with support for Python 3 Update the build system to use pybuild. The new binary package with Python 3 support is named python3-cubicweb-blog according to current standards. Python 2 package is also updated to use the proper namespace and a transitional package has been introduced to handle the migration. Fix MANIFEST.in to include a missing image, extra files to run the tests and to not ship packaging files. Support for Python 3.8 is disabled as it is currently broken in Debian unstable.
MANIFEST.in
debian/control
debian/pybuild.testfiles
debian/rules
debian/source/format
debian/source/options
--- a/MANIFEST.in	Fri Mar 08 07:07:22 2019 +0000
+++ b/MANIFEST.in	Thu Nov 21 17:05:13 2019 +0100
@@ -2,9 +2,9 @@
 include *.py
 include */*.py
 recursive-include cubicweb_blog *.py
-recursive-include cubicweb_blog/data *.gif *.png *.ico *.css *.js
+recursive-include cubicweb_blog/data *.gif *.png *.jpg *.ico *.css *.js
 recursive-include cubicweb_blog/i18n *.po
 recursive-include test/data bootstrap_cubes *.py
 
-recursive-include debian changelog compat control copyright rules
-include cubicweb-blog.spec
+include dev-requirements.txt
+include tox.ini
--- a/debian/control	Fri Mar 08 07:07:22 2019 +0000
+++ b/debian/control	Thu Nov 21 17:05:13 2019 +0100
@@ -2,31 +2,56 @@
 Section: web
 Priority: optional
 Maintainer: Logilab Packaging Team <contact@logilab.fr>
-Uploaders: Sylvain Thenault <sylvain.thenault@logilab.fr>, Nicolas Chauvat <nicolas.chauvat@logilab.fr>
-Build-Depends:
- debhelper (>= 9),
- python (>= 2.7),
- dh-python,
- python-setuptools,
-Standards-Version: 3.9.8 
+Uploaders: Sylvain Thenault <sylvain.thenault@logilab.fr>,
+           Nicolas Chauvat <nicolas.chauvat@logilab.fr>
+Build-Depends: debhelper (>= 9),
+               dh-python,
+               python-all,
+               python-cubicweb,
+               python-cubicweb-sioc,
+               python-pytest,
+               python-setuptools,
+               python3-all,
+               python3-cubicweb,
+               python3-cubicweb-sioc,
+               python3-pytest,
+               python3-setuptools,
+Standards-Version: 4.3.0
 X-Python-Version: >= 2.7
+X-Python3-Version: >= 3.5
 Homepage: https://www.cubicweb.org/project/cubicweb-blog
 
-Package: cubicweb-blog
+Package: python-cubicweb-blog
 Architecture: all
-Depends:
- python-cubicweb (>= 3.24),
- python-six,
- ${python:Depends},
- ${misc:Depends},
-Suggests:
- cubicweb-comment (>= 1.6.3),
- cubicweb-tag,
- cubicweb-sioc,
- python-feedparser,
- python-rdflib
-Recommends: cubicweb-preview, cubicweb-seo
+Depends: ${misc:Depends}, ${python:Depends}
+Suggests: python-cubicweb-comment (>= 1.6.3),
+          python-cubicweb-sioc,
+          python-cubicweb-tag,
+          python-feedparser,
+          python-rdflib,
+Recommends: python-cubicweb-preview, python-cubicweb-seo
 Description: blog component for the CubicWeb framework
  This CubicWeb component provides blogging functionnalities.
  .
  CubicWeb is a semantic web application framework, see http://www.cubicweb.org
+
+Package: python3-cubicweb-blog
+Architecture: all
+Depends: ${misc:Depends}, ${python3:Depends}
+Suggests: python3-cubicweb-comment (>= 1.6.3),
+          python3-cubicweb-sioc,
+          python3-cubicweb-tag,
+          python3-feedparser,
+          python3-rdflib,
+Recommends: python3-cubicweb-preview, python3-cubicweb-seo
+Description: blog component for the CubicWeb framework
+ This CubicWeb component provides blogging functionnalities.
+ .
+ CubicWeb is a semantic web application framework, see http://www.cubicweb.org
+
+Package: cubicweb-blog
+Architecture: all
+Section: oldlibs
+Depends: python-cubicweb-blog, ${misc:Depends}
+Description: transitional package
+ This is a transitional package. It can safely be removed.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/pybuild.testfiles	Thu Nov 21 17:05:13 2019 +0100
@@ -0,0 +1,3 @@
+test
+tox.ini
+cubicweb_blog.egg_info
--- a/debian/rules	Fri Mar 08 07:07:22 2019 +0000
+++ b/debian/rules	Thu Nov 21 17:05:13 2019 +0100
@@ -1,4 +1,9 @@
 #!/usr/bin/make -f
 
+export PYBUILD_NAME = cubicweb-blog
+
+# Python 3.8 is broken in Debian unstable as of 2019-11-21
+export PYBUILD_DISABLE_python3.8 = 1
+
 %:
-	dh $@ --with python2
+	dh $@ --with python2,python3 --buildsystem=pybuild
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/source/format	Thu Nov 21 17:05:13 2019 +0100
@@ -0,0 +1,1 @@
+3.0 (quilt)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/source/options	Thu Nov 21 17:05:13 2019 +0100
@@ -0,0 +1,1 @@
+extend-diff-ignore = "^(.hg(/|ignore$|tags$)|[^/]*\.spec$|__pkginfo__\.py$)"