-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
pyproject.toml files have two standard ways to support specifying dependencies—the [project].dependencies field and [dependency-groups]—which can obviate the need for a separate requirements.txt file.
We have a design decision about where to add dependencies.
- Add everything together into one field (the same way we currently do
requirements.txt) - Split up package runtime dependencies (under the
dependenciesfield) and development dependencies (using dependency groups)
My preference is Option 2, as its follows the conceptual design of pyproject.toml more faithfully. It also would simplify the transition of the project to a published package. However, it comes with the tradeoff of introducing some added complexity to the user of having two lists of dependencies (though in a single config file).
If we choose to use dependency groups at all (e.g., choosing Option 2, or Option 1 but using a dependency group), then this is something that uv as an environment manager supports already. Pip has merged support for it but it hasn't been released yet. It looks like it'll be part of the 25.1 release coming in April.