Package: dh-python
Version: 6.20231223ubuntu1
Severity: normal
Tags: upstream
X-Debbugs-Cc: brett.hol...@canonical.com

Dear Maintainer,

Recently, my project attempted to switch from the distutils pybuild
plugin to the pyproject plugin. Upon doing so, files that were
previously installed at various locations in the root filesystem
started getting installed under a prefix:

/usr/lib/python3/dist-packages/<previous>/<path>/

The files were previously installed using the dh-python distutils
plugin, and setup()'s `data_files` keyword argument passed the
filename.

This change in behavior between plugins prevents our project from using
the pyproject plugin. Is this change in behavior expected? If so, is
there some environment variable override that could be used to override
this behavior to match the distutils behavior.

I am unfamiliar with the dh-python codebase, but poking around in the
source it seems possible that this line[1] is where prepending of Python
path prefix is happening.

A bit of history:
-----------------

In the original commit[2] (5317bb85eca) of this plugin there was some
uncertainty around the destination of data files with a comment:

#FIXME is this the right dest for data?

A later update[3] attempted to follow pip's lead, which was the suggested
fix by a user[4].

While this approach may "work", it does break expectations from the
distutils plugin, and therefore will likely cause breakage in various
projects if we do attempt to make this plugin the default[5].

[1] 
https://salsa.debian.org/python-team/tools/dh-python/-/blob/master/dhpython/build/plugin_pyproject.py?ref_type=heads#L148
[2] 
https://salsa.debian.org/python-team/tools/dh-python/-/commit/afbc167a10c024ce4890a9d520e6a3ba513494f1
[3] 
https://salsa.debian.org/python-team/tools/dh-python/-/commit/5317bb85ecaa25ec707221d036c783c0d2a7c9de
[4] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1025485
[5] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1027864

Note: My apologies if this is the wrong place to file a bug, I don't see
a way to file against the project in salsa.debian.org.

Regards,

Brett Holman


-- System Information:
Debian Release: trixie/sid
  APT prefers noble
  APT policy: (500, 'noble')
Architecture: amd64 (x86_64)

Kernel: Linux 6.8.0-11-generic (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.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.12.1-0ubuntu2
ii  python3-distutils   3.11.5-1
ii  python3-setuptools  68.1.2-2

dh-python recommends no packages.

Versions of packages dh-python suggests:
ii  dpkg-dev           1.22.4ubuntu5
pn  flit               <none>
ii  libdpkg-perl       1.22.4ubuntu5
ii  python3-build      1.0.3-2
pn  python3-installer  <none>
ii  python3-wheel      0.42.0-1

-- no debconf information

Reply via email to