debhelper 指示使用 python3,但使用 python2 运行 setup.py

debhelper instructed to use python3, but runs setup.py with python2

我正在努力 dh 为 python 3(而不是 python 2)创建包。我使用 setup.py,当用 python3 调用时,它会为 python 3 构建。我有一个单独的 debian 目录用于 py3k,所以我只想为那个版本构建。

debian/rules 看起来像这样:

export DH_VERBOSE=1
%:
    dh $@ --with python3

debian/control 具有所有常见的东西,包括 X-Python3-Version:

Source: woo
Maintainer: Václav Šmilauer <eu@doxos.eu>
Section: python
Priority: optional
Build-Depends: python3-setuptools (>= 0.6b3), python3-all, python3-all-dev, debhelper (>= 7.4.3), libboost-all-dev, pyqt4-dev-tools, libqt4-dev, libqt4-dev-bin, qt4-dev-tools, libgle3-dev, libqglviewer-qt4-dev | libqglviewer-dev, libvtk5-dev, libgts-dev, libeigen3-dev, freeglut3-dev
X-Python3-Version: >= 3.4
Standards-Version: 3.9.1

Package: python3-woo
Architecture: any
Depends: ${misc:Depends}, ${python3:Depends}, ${shlibs:Depends}, python3-xlrd, python3-xlwt, python3-numpy, python3-matplotlib, python3-colorama, python3-qt4, python3-xlib, python3-genshi, python3-psutil, python3-minieigen, python3-imaging, python3-h5py, python3-lockfile, ipython3, mencoder | libav-tools | ffmpeg, python3-prettytable
Description: Discrete dynamic compuations, esp. granular mechanics (python 3)
 ...

现在当我 运行 fakeroot debian/rules binary 时,setup.py 是 运行 而 python 而不是 python3,尽管 --with python3 :

$ fakeroot debian/rules binary
dh binary --with python3
   dh_auto_build
pyversions: missing X(S)-Python-Version in control file, fall back to debian/pyversions
pyversions: missing debian/pyversions file, fall back to supported versions
    python setup.py build --force
[...]

有什么问题?

解决方案是将 --buildsystem=pybuild 添加到 debian/rules,这样它看起来像这样:

%:
    dh $@ --with python3 --buildsystem=pybuild