Hi,

On Tue, Dec 21, 2021 at 07:12:26PM +0100, Axel Beckert wrote:
> > That seems like a false-positive: The dataclasses backport is only
> > required for Python 3.6, but Debian sets "Depends: python3 (>= 3.7)"
> > already. 
> […]
> > That smells like a bug in dh-python.
> 
> I tried downgrading dh-python until it no more FTBFS. It doesn't FTBFS
> with dh-python 5.20211114 and the first version it FTBFS is 5.20211213.
> 
> The changelog entry of 5.20211213 contains these potential causes, at
> least from my point of view:
> 
>    * Handle dist-info extra sections the same way we do for requirements.txt.
>      (closes: 998374)

That seems to be related to the "flit" integration, a build system which
qutebrowser does not use: https://flit.readthedocs.io/

>    * Add new pep517 plugin that uses python3-build + python3-installer to 
> build
>      Python modules as wheels and then unpack the wheel. This is the new
>      interface used by modern Python packaging tools. (Closes: #984824)

Could be, but it't not :)

> Full entry (in cases something didn't look suspicious to me) at
> https://packages.qa.debian.org/d/dh-python/news/20211214T010008Z.html
> 
> Florian: Any idea which of these might have broken this?

It's "Add support for environment markers.". Environment markers are
basically conditional dependencies, e.g. for a given Python version or
OS only.

The crash happens here:
https://salsa.debian.org/python-team/tools/dh-python/-/blob/5.20211217/dhpython/pydist.py#L522
because "dependency" is None.

That's coming from here:
https://salsa.debian.org/python-team/tools/dh-python/-/blob/5.20211217/dhpython/pydist.py#L516
i.e. is the return value of "guess_deps".

Looking at that, we spot our error message about dataclasses:
https://salsa.debian.org/python-team/tools/dh-python/-/blob/5.20211217/dhpython/pydist.py#L313-317

...but also a strange commented out "return pname" which has been around
for 7 years:
https://salsa.debian.org/python-team/tools/dh-python/-/commit/de7db9bd0021cee65e477f11cd69cfd93350bd2e

Due to the commented out return, the function ends and implicitly
returns None.

The code which crashes due to that None value is very recent:
https://salsa.debian.org/python-team/tools/dh-python/-/commit/832f01c9c7da22a1d00887d8ce0e6be9893bdf3e

So I suppose it would be good if someone could forward this do
dh-python, I use the Debian bugtracker too seldom to know what the best
way to do this would be (but if preferable, I can open a new bug).

> And is the suggestion to add "dataclasses python3-dataclasses" line to
> debian/py3dist-overrides something we should simply do or is this an
> issue which we should make the dh-python maintainers aware of? I must
> admit, I still don't understand what this is dh-python argues about.
> Maybe someone has some more Python insight for a non-pythonista?

Perhaps both. So what dh-python seems to be doing here is to look at
the dependencies declared in a "requirements.txt" (a somewhat common
way to specify dependencies for Python projects) and check whether the
Debian packaging mirrors those requirements as well. Here is the line in
question:

https://github.com/qutebrowser/qutebrowser/blob/v2.4.0/requirements.txt#L5

So this declares that qutebrowser needs the "dataclasses" backport for
Python versions older than 3.7 (it still supports Python 3.6, though
that will change as soon as 3.0.0 is finished:
https://github.com/qutebrowser/qutebrowser/issues/6905).

However, the Debian package for qutebrowser declares
"Depends: python3 (>= 3.7)", so that dependency actually is irrelevant
for Debian.

Should dh-python handle that case? Well, maybe, but it sure shouldn't
crash.

Florian

-- 
            m...@the-compiler.org | https://www.qutebrowser.org 
       https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
       GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
             I love long mails! | https://email.is-not-s.ms/

Attachment: signature.asc
Description: PGP signature

Reply via email to