Package: dh-python
Version: 4.20201102+nmu1
Severity: important

dh_python3 looks for .egg-info/ (in dhpython/fs.py:Scan).
flit uses .dist-info/.
As a result, install-time dependencies (Depends) do not auto-populate.

I think this needs more than a one-line fix, so I have not produced a fix yet, 
sorry.
I think class Scan needs to be restructured a little to expect either 
.egg-info/ or .dist-info/ - or both?

A test case is jeepney=0.6.0-1 (below)
Likely a few other packages are affected.


    bash5$ grep-dctrl -ns Package -F Build-Depends,Build-Depends-Indep flit 
/var/lib/apt/lists/*Sources | sort -u
    asterisk-flite
    basic256
    brltty
    eflite
    ffmpeg
    flightgear
    gnustep-gui
    gst-plugins-bad1.0
    jeepney
    pd-flite
    python-aiosqlite
    python-hashids
    python-mediafile
    qtspeech-opensource-src
    solo-python
    speech-dispatcher
    speech-dispatcher-contrib
    typer


    bash5$ dgit clone jeepney
    ⋮
    synthesised git commit from .dsc 0.6.0-1

    bash5$ cd jeepney/

    bash5$ cat >>debian/rules
    # Crank up debugging
    override_dh_python3:
            dh_python3 -O--buildsystem=pybuild --verbose

    bash5$ debuild
    ⋮
    make[1]: Entering directory '/tmp/with-temp-dir.gKYsMQ/jeepney'
    dh_python3 -O--buildsystem=pybuild --verbose
    D: dh_python3 dh_python3:161: version: 4.20201102+nmu1
    D: dh_python3 dh_python3:162: argv: ['/usr/bin/dh_python3', 
'-O--buildsystem=pybuild', '--verbose']
    D: dh_python3 dh_python3:163: options: {'guess_deps': True, 'skip_private': 
False, 'verbose': True, 'arch': None, 'package': None, 'no_package': None, 
'compile_all': False, 'vrange': None, 'regexpr': None, 
'accept_upstream_versions': False, 'depends': None, 'depends_section': None, 
'recommends': None, 'recommends_section': None, 'suggests': None, 
'suggests_section': None, 'requires': None, 'shebang': None, 'ignore_shebangs': 
False, 'clean_dbg_pkg': True, 'no_ext_rename': False, 'no_shebang_rewrite': 
False, 'O': '--buildsystem=pybuild'}
    D: dh_python3 dh_python3:164: args: []
    D: dh_python3 dh_python3:165: supported Python versions: 3.9 (default=3.9)
    D: dh_python3 debhelper:99: skipping package jeepney-doc (missing 
${python3:Depends} in Depends)
    D: dh_python3 debhelper:152: source=jeepney, binary 
packages=['python3-jeepney']
    D: dh_python3 dh_python3:183: processing package python3-jeepney...
    D: dh_python3 fs:49: moving files from 
debian/python3-jeepney/usr/lib/python3.9/dist-packages to 
debian/python3-jeepney/usr/lib/python3/dist-packages/
    D: dh_python3 fs:260: package python3-jeepney details = {
            'requires.txt': set(),          <-------- PROBLEM
            'egg-info': set(),              <-------- PROBLEM
            'nsp.txt': set(),
            'shebangs': set(),
            'public_vers': {Version('3')},
            'private_dirs': {},
            'compile': True,
            'ext_vers': set(),
            'ext_no_version': set()}
    D: dh_python3 depends:117: generating dependencies for package 
python3-jeepney
    D: dh_python3 depends:275: D={'python3:any'}; R=[]; S=[]; E=[], B=[]; RT=[]
    make[1]: Leaving directory '/tmp/with-temp-dir.gKYsMQ/jeepney'
    ⋮


    bash5$ cat debian/*substvar*
    sphinxdoc:Depends=libjs-sphinxdoc (>= 1.0), libjs-sphinxdoc (>= 1.8), 
libjs-sphinxdoc (>= 2.0), libjs-sphinxdoc (>= 2.4.3-5~), 
sphinx-rtd-theme-common (>= 0.5.1+dfsg)
    sphinxdoc:Built-Using=sphinx (= 3.4.3-2)
    misc:Depends=
    misc:Pre-Depends=
    python3:Depends=python3:any                   <--------- PROBLEM
    misc:Depends=
    misc:Pre-Depends=


    bash5$ find debian/ -type d -name '*-info' -print -execdir grep -r Require 
{} +
    debian/python3-jeepney/usr/lib/python3/dist-packages/jeepney-0.6.0.dist-info
    ./jeepney-0.6.0.dist-info/METADATA:Requires-Python: >=3.6
    ./jeepney-0.6.0.dist-info/METADATA:Requires-Dist: pytest ; extra == "test"
    ./jeepney-0.6.0.dist-info/METADATA:Requires-Dist: pytest-trio ; extra == 
"test"
    ./jeepney-0.6.0.dist-info/METADATA:Requires-Dist: pytest-asyncio ; extra == 
"test"
    ./jeepney-0.6.0.dist-info/METADATA:Requires-Dist: testpath ; extra == "test"
    ./jeepney-0.6.0.dist-info/METADATA:Requires-Dist: trio ; extra == "test"


Hrm, maybe the fact that those are all "test" means they are ignored.
Can I reproduce this somewhere else?

OK yes, attached is a minimal test package and its output deb.



-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'testing-security'), (500, 'unstable'), 
(1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-6-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages dh-python depends on:
ii  python3            3.9.2-2
ii  python3-distutils  3.9.2-1

dh-python recommends no packages.

Versions of packages dh-python suggests:
ii  dpkg-dev      1.20.7.1
ii  libdpkg-perl  1.20.7.1

-- no debconf information
Format: 3.0 (native)
Source: xx
Binary: python3-xx
Architecture: all
Version: 0~1
Maintainer: abuse@ai
Standards-Version: 4.5.0
Build-Depends: debhelper-compat (= 13), dh-sequence-python3, flit, python3-all
Package-List:
 python3-xx deb devel optional arch=all
Checksums-Sha1:
 1f4061320292d5746371d92da9747e76c99f73c1 1036 xx_0~1.tar.xz
Checksums-Sha256:
 212dabdcb4e0365548c0d02021cbc71cc8e8b3ec5aa1f873e8037b1354e72d0c 1036 
xx_0~1.tar.xz
Files:
 19f7e10cd43514a0e2203c6082029abe 1036 xx_0~1.tar.xz

Attachment: xx_0~1.tar.xz
Description: application/xz

Attachment: python3-xx_0~1_all.deb
Description: application/vnd.debian.binary-package

Reply via email to