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

Support dependency groups from poetry #1706

Open
joshbrooks opened this issue Oct 20, 2022 · 3 comments
Open

Support dependency groups from poetry #1706

joshbrooks opened this issue Oct 20, 2022 · 3 comments
Labels
feature Request for a new feature

Comments

@joshbrooks
Copy link

What's the problem this feature will solve?

Is it possible to support Poetry groups via --extra? It seems that they are not (yet) supported

Poetry supports both "extras" and "dependency groups". pip-compile supports "extras" but (afaik) does not support "dependency groups".

Poetry encourages the use of "dependency groups" for e.g. dev requirements.

Describe the solution you'd like

Poetry encourages the use of a "dev" group for dependencies. From the Poetry docs

you might have dependencies that are only needed to test your project or to build the documentation.

Further, poetry encourages dev dependencies to be put into a group:

$ poetry add --dev black
The --dev option is deprecated, use the `--group dev` notation instead.

An an example, if I include isort in "extras" via pip-compile -v --extra dev -o dev-requirements.txt pyproject.toml isort will be included in requirements

[tool.poetry.dependencies]
python = "^3.7"
isort = "^5.9.3"

[tool.poetry.extras]
dev = [
  "isort",
]

However when I use the dev group it will not be inlcuded

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

[tool.poetry.group.dev.dependencies]
isort = "^5.10.1"

Alternative Solutions

As a workaround, I can use extra with a list of dev dependencies.

Additional context

@q0w
Copy link
Contributor

q0w commented Oct 21, 2022

Currently not, because it seems pip-tools builds wheels to get metadata['Provides-Extra'], and poetry group dependencies are not exposable to wheel metadata. So to do it, pip-tools needs to manually parse pyproject

@RonnyPfannschmidt
Copy link
Member

As this is a poetry extension, I believe it's fair not to support it until a pep is accepted

@merwok
Copy link

merwok commented Oct 25, 2022

@atugushev atugushev added the feature Request for a new feature label Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Request for a new feature
Projects
None yet
Development

No branches or pull requests

5 participants