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

Retrieve development dependencies from all dependencies groups in Poetry #391

Closed
mkniewallner opened this issue May 10, 2023 · 3 comments · Fixed by #392
Closed

Retrieve development dependencies from all dependencies groups in Poetry #391

mkniewallner opened this issue May 10, 2023 · 3 comments · Fixed by #392
Assignees
Labels
enhancement New feature or request

Comments

@mkniewallner
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

On projects using Poetry, only [tool.poetry.dev-dependencies] and [tool.poetry.group.dev.dependencies] are considered for retrieving development dependencies.

Since groups only work locally, it is probably safe to assume that dependencies in all groups are development dependencies, regarding of the group. This would also be in line with what we do for PDM, where all dependencies groups are parsed.

Describe the solution you would like

Instead of just parsing [tool.poetry.dev-dependencies] and [tool.poetry.group.dev.dependencies], deptry should parse [tool.poetry.dev-dependencies] and all [tool.poetry.group.<group>.dependencies] to retrieve development dependencies.

Additional context

There might be reasons for users to opt-out from reading dependencies from specific groups (for instance, a specific group that defines dependencies only used by a CI workflow), but we could consider implementing that only if this is a feature that is requested by users.

@jc-louis
Copy link

jc-louis commented May 3, 2024

@mkniewallner I think this a mistake, poetry groups are not used only locally (we use them to group per apps in a monorepo), so they are not dev dependencies in all cases.

@mkniewallner
Copy link
Collaborator Author

@mkniewallner I think this a mistake, poetry groups are not used only locally (we use them to group per apps in a monorepo), so they are not dev dependencies in all cases.

Indeed, I must say that I've never used Poetry for mono repositories, so I did not have this use case in mind.

Would a new option similar to https://deptry.com/usage/#pep-621-dev-dependency-groups, but specific to Poetry, would work? By default, we could keep the behaviour as it is today (i.e. all groups are considered as dev depencenies), but if the user specifies a value, then they'll be able to explicitly specify which groups should be considered as dev ones.

@maciejb
Copy link

maciejb commented Jul 11, 2024

@mkniewallner I have a similar use case, using poetry groups to define a few different execution environments with overlapping dependencies. An option similar to pep-621 but for Poetry would work perfectly in my case.

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

Successfully merging a pull request may close this issue.

3 participants