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

Feature Request: Add Poetry dependency group support to uv pip compile #5278

Closed
siavashyj opened this issue Jul 22, 2024 · 4 comments
Closed

Comments

@siavashyj
Copy link

siavashyj commented Jul 22, 2024

Description

Currently, uv pip compile does not support Poetry's dependency groups feature. Adding this support would greatly enhance uv's compatibility with Poetry projects and improve workflow for developers who use both tools.

Use Case

Many projects use Poetry's dependency groups to separate different sets of dependencies (e.g., development dependencies, test dependencies, etc.). Being able to compile requirements files for specific groups using uv pip compile would streamline the process of managing dependencies in these projects.

Proposed Functionality

  1. Add a new option to uv pip compile, such as --poetry-group or -g, that allows specifying one or more Poetry dependency groups.
  2. When this option is used, uv pip compile should read the pyproject.toml file and only include dependencies from the specified group(s) in the compiled requirements file.
  3. If no group is specified, the default behavior should be to include all dependencies (similar to Poetry's behavior).

Example Usage

uv pip compile --poetry-group dev -o requirements-dev.txt
uv pip compile --poetry-group dev,test -o requirements-dev-test.txt

Additional Considerations

  • How should conflicts between groups be handled if multiple groups are specified?
  • Should there be an option to exclude certain groups?
  • How should this feature interact with other existing uv pip compile options?

Benefits

  1. Improved compatibility with Poetry projects
  2. More granular control over dependency compilation
  3. Easier management of different environments (development, testing, production, etc.)
@jamesbraza
Copy link

An aside is Poetry could be then paired with Rye to resolve astral-sh/rye#421, albeit in a hacky way where one has both Rye and Poetry present in the same ecosystem 😆

@zanieb
Copy link
Member

zanieb commented Jul 22, 2024

I don't think we'll add support for reading Poetry's configuration (similarly, we have avoided reading pip's configuration). Instead, I'd point to PEP 735 which proposes a standardized format for dependency groups.

@zanieb
Copy link
Member

zanieb commented Jul 22, 2024

(Thanks for the comprehensive overview though, I appreciate it!)

@charliermarsh
Copy link
Member

Agreed. Unfortunately I think we're unlikely to support this both because we avoid reading configuration designed for other tools and because Poetry's dependency syntax and semantics are not standardized and entirely custom to Poetry.

@charliermarsh charliermarsh closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2024
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

4 participants