-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about export of dependency with extra, e.g. httpx[http2], in Python 1.8.5 vs this plugin #326
Comments
I would say this is expected and does not matter because all dependencies are resolved. (You should always install an exported requirements.txt with poetry-plugin-export/tests/test_exporter.py Lines 2409 to 2425 in 875cda2
With old lock files, the exporter has to do some kind of resolution and knows the requested extras from the pyproject.toml. With new lock files, the exporter just iterates over the locked packages - and the lock file does not contain information which extras have been requested. I think we could change it back if there is a good reason but it will make the export code more complicated. |
I really appreciate the quick response. Thank you! We're about to convert a bunch of repos over to Unfortunately, I don't understand your parenthetical "You should always install an exported requirements.txt with --no-deps anyway." The pip doc explains that as "Don’t install package dependencies." But if I'm using I am obviously confused about what
If that article is correct, no need to respond to my confusion! Again, I appreciate your answer about the missing |
The exported requirements.txt includes all direct and transitive dependencies. Further, it represents a universal solution for all possible environments so even if you export on your Windows box and there is a package you only need on Linux, this package will be included with a marker like The quoted paragraph is correct and also applies to requirements.txt files exported with poetry. |
I attempted to create two identical projects, one using Poetry 1.8.5 and the other using Poetry 2.1.1 with this plugin.
The folder trees of both are analogous:
with this
pyproject.toml
vs
with this
pyproject.toml
I did a
poetry export --without-hashes --without-urls
of both projects and have attached the output below. The question is that the version 1.8.5 export has this line:httpx[http2]==0.28.1 ; python_version >= "3.13" and python_version < "4.0"
whereas the version 2.1.1 export has this line:
httpx==0.28.1 ; python_version >= "3.13" and python_full_version < "4.0.0"
Note that the
[http2]
is missing. Since both requirements files have a line forh2
, which is all that[http2]
ends up meaning for thehttpx
package, I guess I haven't lost anything due to that missing[http2]
if I go use the requirements file in a Dockerfile build process. But the difference was confusing to me, and I was hoping to hear from someone who knows how this is supposed to work. Ought the two requirements files show the same thing?When I
poetry build
both projects, the.whl
files'METADATA
each contain this line:reqs_185.txt
reqs_211.txt
The text was updated successfully, but these errors were encountered: