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

'extra' poetry dependencies are not checked #41

Open
yrro opened this issue Feb 18, 2023 · 1 comment
Open

'extra' poetry dependencies are not checked #41

yrro opened this issue Feb 18, 2023 · 1 comment

Comments

@yrro
Copy link

yrro commented Feb 18, 2023

I just noticed that convert_poetry_to_requirements works by running poetry export --with=dev and feeding the output to safety check.

When a project has 'extra' dependencies, they are not included in the output of poetry export --with-dev.

Here's a demonstration using https://github.com/yrro/hitron-exporter/:

$ poetry export --with=dev | grep '^[^ ]' | wc -l
30

$ poetry export --with=dev -E freeipa-vault -E container | grep '^[^ ]' | wc -l
48

Unfortunately poetry export dosn't have a way to include all extra dependencies; you probably have to parse pyproject.toml and construct the list of extras by looking for this part:

[tool.poetry.extras]
freeipa-vault = ["ipaclient", "ipapython"]
container = ["gunicorn", "setproctitle"]
@yrro yrro changed the title 'poetry export --with=dev' misses 'extra' dependencies 'extra' poetry dependencires are not checked Feb 18, 2023
yrro added a commit to yrro/hitron-exporter that referenced this issue Feb 18, 2023
@Lucas-C
Copy link
Owner

Lucas-C commented Feb 19, 2023

@yrro thanks for the report

That's indeed a limitation when using poetry.
Related issue: python-poetry/poetry-plugin-export#45

I'd prefer not to include some pyproject.toml-parsing logic in this tool, and wait for Poetry to support --all.

@yrro yrro changed the title 'extra' poetry dependencires are not checked 'extra' poetry dependencies are not checked Feb 19, 2023
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