Your message dated Fri, 6 Nov 2026 10:54:33 +0000
with message-id <[email protected]>
and subject line Re: Bug#1149717: pybuild fails to build backports of packages 
with native versions
has caused the Debian Bug report #1149717,
regarding pybuild fails to build backports of packages with native versions
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1149717: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1149717
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: dh-python
Version: 6.20250414
Severity: normal
File: /usr/share/perl5/Debian/Debhelper/Buildsystem/pybuild.pm

Hi!

I have been having trouble building backports of a package with
setuptools-scm as a build-dep.

lavamind eventually figured a hack out of this, which you can see
here:

https://gitlab.com/anarcat/asncounter/-/commit/5a5cbb3c5c78152af791da09c0230ec6818d16d0

which is essentially to add this to the debian/rules file:

export SETUPTOOLS_SCM_PRETEND_VERSION=$(shell dpkg-parsechangelog -SVersion | 
sed -e 's/^[[:digit:]]*://' -e 's/[-].*//' -e 's/~git.*//' -e 's/~bpo.*//' -e 
's/~/.0/' -e 's/+dfsg1//' -e 's/+ds1//' | head -n 1)

... to override the "pretend" version.

Before that, the build would fail with:

packaging.version.InvalidVersion: Invalid version: '0.7.0-bpo13+1'

And, indeed, that is an invalid package version in Python:

>>> from packaging import version
>>> version.Version("0.7.0-bpo13+1")
Traceback (most recent call last):
  File "<python-input-2>", line 1, in <module>
    version.Version("0.7.0-bpo13+1")
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/packaging/version.py", line 202, in 
__init__
    raise InvalidVersion(f"Invalid version: {version!r}")
packaging.version.InvalidVersion: Invalid version: '0.7.0-bpo13+1'

Normal Debian versions with dashes are okay, that said:

>>> version.Version("0.7.0-1")
<Version('0.7.0.post1')>

I'm not sure what should be done to fix this. wRAR on #debian-python
suggested I file this bug report, but also that the `+` could be
replaced with a dash, but that doesn't work either:

packaging.version.InvalidVersion: Invalid version: '0.7.0-bpo13-1'

We *could* replace "bpo" with "pre" which would work and would even
mean something somewhat similar:

>>> version.Version("0.7.0-pre13-1")
<Version('0.7.0rc13.post1')>
>>> version.Version("0.7.0-pre13-1") < version.Version("0.7.0-1")
True

But really, as far as Python is concerned, I would just strip out any
debian specific stuff and stay with the upstream version, in this case
`0.7.0`.

The full build log is available at:

https://paste.lib3.net/lavamind/2026-09-29-xhBAI9DJyb8DNU2IHfJTDJLAQhw3qk9qzYWn5387UVg/stdin.txt

And can be reproduced by trying to backport the 0.7.0-1 asncounter
package without change.

-- System Information:
Debian Release: 13.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'stable-debug'), (500, 'stable'), (1, 'experimental'), (1, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.111+deb13-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.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.13.5-1

dh-python recommends no packages.

Versions of packages dh-python suggests:
ii  dpkg-dev           1.22.22
pn  flit               <none>
ii  libdpkg-perl       1.22.22
ii  python3-build      1.2.2-2
ii  python3-installer  0.7.0+dfsg1-3
ii  python3-wheel      0.46.1-2

-- no debconf information

--- End Message ---
--- Begin Message ---
Version: 7.20261019

FWIW, this was recently fixed in [0] but we obviously missed this bug.

[0]: 
https://salsa.debian.org/python-team/tools/dh-python/-/commit/ba9cca3f6725fa9eaec24cc299273797522027e4

To help you in your use-case, we'd have to get this dh-python into stable / backports. Let's think about that once the 3.15 transition is over.

Stefano

--
Stefano Rivera
  http://tumbleweed.org.za/
  +1 415 683 3272

--- End Message ---

Reply via email to