[debhelper-devel] Bug#769840: debhelper: fails to build a python3 package

Forest web11.forest at tibit.com
Sun Nov 16 23:18:04 UTC 2014


Package: debhelper
Version: 9.20131227ubuntu1
Severity: normal

Dear Maintainer,

When packaging a python 3 program, debhelper causes all build targets
(including clean) to fail. The underlying cause seems to be that it insists
on running the python2-only pyversions program to process setup.py, despite
setup.py using python3 syntax, and despite all the obvious signs that it is
a python3 build. For example:

- setup.py starts with #!/usr/bin/env python3
- control contains Build-Depends: python3 (and not python or python2)
- control contains X-Python3-Version: (and not X-Python-Version)
- rules contains %:     dh $@ --with python3

The failure occurs regardless of whether the dh command line includes
--with python3.

After quite a bit of groveling through documentation and mailing list archives,
I discovered that adding --buildsystem=pybuild to the dh command line works
around the problem. However, this is not documented in the Debian Python Policy
or apparently anyplace else where it really should appear. For example:

https://www.debian.org/doc/packaging-manuals/python-policy/
https://wiki.debian.org/Python/FAQ
https://wiki.debian.org/Python/
https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#customrules
the dh man page
the debhelper man page

This seems like a pretty big oversight. The Python Policy makes it very clear
that programs should use python 3, but the packaging tools fail when following
that policy:

https://www.debian.org/doc/packaging-manuals/python-policy/ch-python3.html
"Programs should use Python 3, and should not be packaged for Python 2 as well. Python 3 should be used for the packaging if the packaging scripts use Python."

If there is a good reason why the tools can't be made to follow the policy,
shouldn't the workaround be documented in an obvious place, at least?

Thanks for your attention.

-- System Information:
Debian Release: jessie/sid
  APT prefers trusty-updates
  APT policy: (500, 'trusty-updates'), (500, 'trusty-security'), (500, 'trusty'), (100, 'trusty-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.13.0-39-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages debhelper depends on:
ii  binutils     2.24-5ubuntu3
ii  dh-apparmor  2.8.95~2430-0ubuntu5
ii  dpkg         1.17.5ubuntu5.3
ii  dpkg-dev     1.17.5ubuntu5.3
ii  file         1:5.14-2ubuntu3.2
ii  man-db       2.6.7.1-1ubuntu1
ii  perl         5.18.2-2ubuntu1
ii  po-debconf   1.0.16+nmu2ubuntu1

debhelper recommends no packages.

Versions of packages debhelper suggests:
pn  dh-make  <none>

-- no debconf information




More information about the debhelper-devel mailing list