On Thursday, July 20, 2023 10:58:03 AM EDT Piotr Ożarowski wrote:
> [Scott Kitterman, 2023-07-20]
> 
> > I had to override dh_python3 to add --no-guessing-deps in the latest
> 
> FTR: you can override detection with debian/py3dist-overrides (see
> dh_python3's manpage or /usr/share/doc/dh-python/README.PyDist for more
> details)
> 
> > dnspython upload because it was getting things wrong.  Here's what it
> > generated:
> > 
> > python3-httpcore | python3 (<< 3.8), python3-sniffio, python3:any
> > 
> > The correct answer here is actually use python3:any.  Here's what I
> > think is going on:
> > 
> > From the pyproject.toml file:
> > 
> > [tool.poetry.dependencies]
> > python = "^3.8"
> > httpx = {version=">=0.24.1", optional=true, python=">=3.8"}
> > httpcore = {version=">=0.17.3", optional=true, python=">=3.8"}
> > h2 = {version=">=4.1.0", optional=true, python=">=3.8"}
> > idna = {version=">=2.1,<4.0", optional=true}
> > cryptography = {version=">=2.6,<42.0", optional=true}
> > trio = {version=">=0.14,<0.23", optional=true}
> > sniffio = {version="^1.1", optional=true}
> > wmi = {version="^1.5.1", optional=true}
> > aioquic = {version=">=0.9.20", optional=true}
> > 
> > ...
> > 
> > [tool.poetry.extras]
> > doh = ['httpx', 'h2']
> > idna = ['idna']
> > dnssec = ['cryptography']
> > trio = ['trio']
> > wmi = ['wmi']
> > doq = ['aioquic']
> > 
> > There are two issues:
> > 
> > 1.  httpcore and sniffio shouldn't be listed at all.  They are optional.
> > I suspect that either poetry or dh-python is looking at the extras
> > section and since those packages aren't listed for one of the extras, it
> > assumes the package is required, despite the optional flag.  They
> > probably should be listed somewhere (upstream bug), but I think if it
> > says optional, it shouldn't be added to Depends.
> 
> dh_python3 doesn't look at source files. It generates dependencies by
> parsing installed requires.txt file so IMHO it's an upstream / poetry bug
> 
> > 2.  Generating an optional depends on python3 << 3.8 isn't helpful.  It
> > looks to me like {version=">=0.17.3", optional=true, python=">=3.8"} is
> > being mis-interpreted.  I believe the intent here is to say that the
> > dependency is optional when python3 > 3.8, not you need it if python3 >
> 
> can you show me how poetry / pyproject / whatever parsed this file
> interpreted it? I.e. what's in installed requires.txt
> 
> (I suspect it's a hard dependency there)
> 
> > 3.8.  There's a larger question of why the interpreter version is there
> > at all, given that's now the minimum python3 version supported, but
> > that's an upstream issue, we ought to get it right.
> 
> I agree

I have so far managed to avoid learning anything about how poetry works 
internally (learning about flit fully exhausted my curiosity in this area).  

Emmanuel,

Can you help out with this?

Thanks,

Scott K

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to