Skip to content

Add pyproject.toml as dependency file option #431

@jayqi

Description

@jayqi

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.

  1. Add everything together into one field (the same way we currently do requirements.txt)
  2. Split up package runtime dependencies (under the dependencies field) 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions