Skip to content
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

Extras output differs from 1.1.15 #108

Closed
Limess opened this issue Aug 31, 2022 · 4 comments
Closed

Extras output differs from 1.1.15 #108

Limess opened this issue Aug 31, 2022 · 4 comments

Comments

@Limess
Copy link

Limess commented Aug 31, 2022

Hello,

Upon attempting to upgrade Poetry from 1.1.15 to 1.2.0, I noticed the following change in behaviour.

poetry export now includes extra definitions, previously these were expanded.

With this config (reduced for simplicity)

[tool.poetry.dependencies]
python = "~3.10"
connexion = { version = "^2.4.1", extras = ["flask", "swagger-ui"] }

Before - 1.1.15:
pipx run poetry==1.1.15 export --without-hashes -f requirements.txt -o ./requirements.txt

attrs==22.1.0; python_version >= "3.7"
certifi==2022.6.15; python_version >= "3.7" and python_version < "4"
charset-normalizer==2.1.1; python_version >= "3.7" and python_version < "4" and python_full_version >= "3.6.0"
click==8.1.3; python_version >= "3.7"
clickclick==20.10.2; python_version >= "3.6"
colorama==0.4.5; python_version >= "3.7" and python_full_version < "3.0.0" and platform_system == "Windows" or platform_system == "Windows" and python_version >= "3.7" and python_full_version >= "3.5.0"
connexion==2.14.1; python_version >= "3.6"
flask==2.2.2; python_version >= "3.7"
idna==3.3; python_version >= "3.7" and python_version < "4"
inflection==0.5.1; python_version >= "3.6"
itsdangerous==2.1.2; python_version >= "3.7"
jinja2==3.1.2; python_version >= "3.7"
jsonschema==4.15.0; python_version >= "3.7"
markupsafe==2.1.1; python_version >= "3.7"
packaging==21.3; python_version >= "3.6"
pyparsing==3.0.9; python_full_version >= "3.6.8" and python_version >= "3.6"
pyrsistent==0.18.1; python_version >= "3.7"
pyyaml==6.0; python_version >= "3.6"
requests==2.28.1; python_version >= "3.7" and python_version < "4"
swagger-ui-bundle==0.0.9; python_version >= "3.6"
urllib3==1.26.12; python_version >= "3.7" and python_full_version < "3.0.0" and python_version < "4" or python_full_version >= "3.6.0" and python_version < "4" and python_version >= "3.7"
werkzeug==2.2.2; python_version >= "3.7"

After - 1.2.0:
pipx run poetry==1.2.0 export --without-hashes -f requirements.txt -o ./requirements.txt

attrs==22.1.0 ; python_version >= "3.10" and python_version < "3.11"
certifi==2022.6.15 ; python_version >= "3.10" and python_version < "3.11"
charset-normalizer==2.1.1 ; python_version >= "3.10" and python_version < "3.11"
click==8.1.3 ; python_version >= "3.10" and python_version < "3.11"
clickclick==20.10.2 ; python_version >= "3.10" and python_version < "3.11"
colorama==0.4.5 ; python_version >= "3.10" and python_version < "3.11" and platform_system == "Windows"
connexion[flask,swagger-ui]==2.14.1 ; python_version >= "3.10" and python_version < "3.11"
flask==2.2.2 ; python_version >= "3.10" and python_version < "3.11"
idna==3.3 ; python_version >= "3.10" and python_version < "3.11"
inflection==0.5.1 ; python_version >= "3.10" and python_version < "3.11"
itsdangerous==2.1.2 ; python_version >= "3.10" and python_version < "3.11"
jinja2==3.1.2 ; python_version >= "3.10" and python_version < "3.11"
jsonschema==4.15.0 ; python_version >= "3.10" and python_version < "3.11"
markupsafe==2.1.1 ; python_version >= "3.10" and python_version < "3.11"
packaging==21.3 ; python_version >= "3.10" and python_version < "3.11"
pyparsing==3.0.9 ; python_version >= "3.10" and python_version < "3.11"
pyrsistent==0.18.1 ; python_version >= "3.10" and python_version < "3.11"
pyyaml==6.0 ; python_version >= "3.10" and python_version < "3.11"
requests==2.28.1 ; python_version >= "3.10" and python_version < "3.11"
swagger-ui-bundle==0.0.9 ; python_version >= "3.10" and python_version < "3.11"
urllib3==1.26.12 ; python_version >= "3.10" and python_version < "3.11"
werkzeug==2.2.2 ; python_version >= "3.10" and python_version < "3.11"

As the dependencies are already expanded to include extras (connexion[flask,swagger-ui]), it seems redundant to include the extras in the end requirements.txt.

This breaks some existing parsing we had to make the output of poetry export compatible with a given constraints file.

@dimbleby
Copy link
Contributor

It is correct and necessary to include extras explicitly because of eg python-poetry/poetry#5537, else pip install of the output requirements.txt fails per that issue.

So I think this is going to be wont-fix, and you'll need to update your parsing - sorry

@Limess
Copy link
Author

Limess commented Aug 31, 2022

Thanks for the clarification

@Limess Limess closed this as completed Aug 31, 2022
@NickG123
Copy link

@dimbleby in that case, how hard would it be to support a constraints export format? As extras are not supported in constraints files, and using a requirements.txt file output by poetry 1.2.0 now results in

ERROR: Constraints cannot have extras

@dimbleby
Copy link
Contributor

I've never looked into constraints format, if the only meaningful difference is omitting extras then it can't be that hard, you'd think.

on the other hand it might be even easier for you just to sed the [extras] away...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants