PEP 735 describes dependency groups as sets of optional dependencies that are not shipped with the package but intended for development purposes.
The PEP includes an example for groups that include test, docs, typing, and a combo typing-test.
[dependency-groups] test = ["pytest", "coverage"] docs = ["sphinx", "sphinx-rtd-theme"] typing = ["mypy", "types-requests"] typing-test = [{include-group = "typing"}, {include-group = "test"}, "useful-types"]
This is implemented in uv and can be used by several of their commands.
uv sync --group test uv run --group test uv add --group test pytest uv remove --group test pytest uv export --group test uv tree --group test
Dependency Groups are not Extras #
The docs describe extras as being intended to ship with the application and dependency groups intended for development. The spec allows both to exist with the same name, but care should be taken as tools may have different implementations.
...