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-elasticsearch 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.

Both packages depends on the python{,3}-elasticsearch-dsl, currently available at: https://salsa.debian.org/lunar/elasticsearch-dsl-py

Fix MANIFEST.in to include missing test files.

Support for Python 3.8 is disabled as it is currently broken in Debian unstable.

authorJérémy Bobbio <jeremy.bobbio@irq7.fr>
changesete96b8e3e5e63
branchdefault
phasepublic
hiddenno
parent revision#48f01895be54 Fix tests for Python 3
child revision#e275070e9e2f [es7] Prepare support for elasticsearch 7.0.0
files modified by this revision
MANIFEST.in
debian/control
debian/pybuild.testfiles
debian/rules
debian/source/format
debian/source/options
# HG changeset patch
# User Jérémy Bobbio <jeremy.bobbio@irq7.fr>
# Date 1574416401 -3600
# Fri Nov 22 10:53:21 2019 +0100
# Node ID e96b8e3e5e63c0c9dd40db6931c414a4a64dfb20
# Parent 48f01895be54f091c75706780854fd61f6df4ba8
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-elasticsearch 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.

Both packages depends on the python{,3}-elasticsearch-dsl,
currently available at:
https://salsa.debian.org/lunar/elasticsearch-dsl-py

Fix MANIFEST.in to include missing test files.

Support for Python 3.8 is disabled as it is currently broken
in Debian unstable.

diff --git a/MANIFEST.in b/MANIFEST.in
@@ -1,5 +1,9 @@
1  include *.py
2  include */*.py
3  recursive-include cubicweb_elasticsearch *.py
4  recursive-include cubicweb_elasticsearch/data *.gif *.png *.ico *.css *.js
5  recursive-include cubicweb_elasticsearch/i18n *.po
6 +recursive-include cubicweb_elasticsearch/pviews/templates *.jinja2
7 +
8 +include test/data/bootstrap_cubes
9 +include tox.ini
diff --git a/debian/control b/debian/control
@@ -1,32 +1,60 @@
10  Source: cubicweb-elasticsearch
11  Section: web
12  Priority: optional
13  Maintainer: LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
14  Homepage: https://www.cubicweb.org/project/cubicweb-elasticsearch
15 -Build-Depends:
16 - debhelper (>= 9),
17 - python (>= 2.6.5),
18 - python-setuptools,
19 -Standards-Version: 3.9.6
20 -X-Python-Version: >= 2.6
21 +Build-Depends: debhelper (>= 9),
22 +               dh-python,
23 +               python-all,
24 +               python-bs4,
25 +               python-cubicweb,
26 +               python-cubicweb-blog,
27 +               python-cwtags,
28 +               python-elasticsearch-dsl,
29 +               python-ipaddress,
30 +               python-logilab-common,
31 +               python-mock,
32 +               python-pytest,
33 +               python-setuptools,
34 +               python3-all,
35 +               python3-bs4,
36 +               python3-cubicweb,
37 +               python3-cubicweb-blog,
38 +               python3-cwtags,
39 +               python3-elasticsearch-dsl,
40 +               python3-logilab-common,
41 +               python3-mock,
42 +               python3-pytest,
43 +               python3-setuptools
44 +Standards-Version: 4.3.0
45 +X-Python-Version: >= 2.7
46 +X-Python3-Version: >= 3.5
47 
48 -Package: cubicweb-elasticsearch
49 +Package: python-cubicweb-elasticsearch
50  Architecture: all
51 -Depends:
52 - ${python:Depends},
53 - ${misc:Depends},
54 - cubicweb-common (>= 3.24.0),
55 - python-six (>= 1.4.0),
56 - python-bs4,
57 - python-cwtags,
58 - python-elasticsearch (>= 6.0.0),
59 - python-elasticsearch (<< 7.0.0),
60 - python-elasticsearch-dsl (>= 6.0.0),
61 - python-elasticsearch-dsl (<< 7.0.0),
62 +Depends: ${misc:Depends}, ${python:Depends}
63  Description: Simple ElasticSearch indexing integration for CubicWeb
64   CubicWeb is a semantic web application framework.
65   .
66   Simple ElasticSearch indexing integration for CubicWeb
67   .
68   This package will install all the components you need to run the
69   cubicweb-elasticsearch application (cube :)..
70 +
71 +Package: python3-cubicweb-elasticsearch
72 +Architecture: all
73 +Depends: ${misc:Depends}, ${python3:Depends}
74 +Description: Simple ElasticSearch indexing integration for CubicWeb
75 + CubicWeb is a semantic web application framework.
76 + .
77 + Simple ElasticSearch indexing integration for CubicWeb
78 + .
79 + This package will install all the components you need to run the
80 + cubicweb-elasticsearch application (cube :)..
81 +
82 +Package: cubicweb-elasticsearch
83 +Architecture: all
84 +Section: oldlibs
85 +Depends: python-cubicweb-elasticsearch, ${misc:Depends}
86 +Description: transitional package
87 + This is a transitional package. It can safely be removed.
diff --git a/debian/pybuild.testfiles b/debian/pybuild.testfiles
@@ -0,0 +1,3 @@
88 +test
89 +tox.ini
90 +cubicweb_elasticsearch.egg-info
diff --git a/debian/rules b/debian/rules
@@ -1,4 +1,9 @@
91  #!/usr/bin/make -f
92 
93 +export PYBUILD_NAME = cubicweb-elasticsearch
94 +
95 +# Python 3.8 is broken in Debian unstable as of 2019-11-21
96 +export PYBUILD_DISABLE_python3.8 = 1
97 +
98  %:
99 -	dh $@ --with python2
100 +	dh $@ --with python2,python3 --buildsystem=pybuild
diff --git a/debian/source/format b/debian/source/format
@@ -0,0 +1,1 @@
101 +3.0 (quilt)
diff --git a/debian/source/options b/debian/source/options
@@ -0,0 +1,1 @@
102 +extend-diff-ignore = "^(.hg(/|ignore$|tags$)|[^/]*\.spec$|__pkginfo__\.py|\.gitlab-ci.yml$)"