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

poetry export --without exports optional dependency groups #11

Closed
pmav99 opened this issue Sep 30, 2021 · 2 comments
Closed

poetry export --without exports optional dependency groups #11

pmav99 opened this issue Sep 30, 2021 · 2 comments

Comments

@pmav99
Copy link
Contributor

pmav99 commented Sep 30, 2021

This is similar to python-poetry/poetry#4577

if you use --without, then the optional dependencies get exported unless you explicitly use --without on them

[tool.poetry]
name = "aaa"
version = "0.1.0"
description = ""
authors = ["pmav99 <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.9"

[tool.poetry.group.test]
optional = true
[tool.poetry.group.foo]
optional = true

[tool.poetry.group.test.dependencies]
pytest= "*"

[tool.poetry.group.foo.dependencies]
black = "*"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

E.g. here we use --without on a non-existing group and we notice that both optional groups got exported.

$ poetry export --without-hashes --without gibberish | ag 'pytest|black'
black==21.9b0; python_full_version >= "3.6.2"
pytest==6.2.5; python_version >= "3.6"

If we explicitly use --without on either one of the optional groups, then they are indeed excluded from the output

$ poetry export --without-hashes --without gibberish --without test| ag 'pytest|black'
black==21.9b0; python_full_version >= "3.6.2"

and

$ poetry export --without-hashes --without gibberish --without foo | ag 'pytest|black'
pytest==6.2.5; python_version >= "3.6"
@dimbleby
Copy link
Contributor

All the examples above now export nothing, this seems to be fixed.

@pmav99
Copy link
Contributor Author

pmav99 commented May 28, 2022

Indeed. Closing

@pmav99 pmav99 closed this as completed May 28, 2022
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

2 participants