Skip to content

Commit 5bb5898

Browse files
committed
reword discussion of dependency-groups
1 parent 8734366 commit 5bb5898

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

docs/_includes/pyproject.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,9 @@ work to call the app (`__name__` will be `"__main__"` in that case).
110110

111111
### Development dependencies
112112

113-
It is recommended to use dependency-groups instead of making requirement files.
114-
This allows you to specify dependencies that are only needed for development;
115-
unlike extras, they are not available when installing via PyPI, but they are
116-
available for local installation, and the `dev` group is even installed by
117-
default when using `uv`.
118-
113+
The proper way to specify dependencies exclusively used for devlopment tasks (such as `pytest`, `ruff`, packages for generating documentation, etc.) is to use dependency-groups.
114+
Dependency-groups are recommended over requirement files because they are formally standardized (i.e. they will be more portable going forward) and they are more composable.
115+
In contrast with extras, dependency-groups are not available when installing your package via PyPI, but they are available for local installation (and can be installed separately from your package); the `dev` group is even installed, by default, when using `uv`.
119116
Here is an example:
120117

121118
```toml
@@ -130,10 +127,11 @@ dev = [
130127

131128
You can include one dependency group in another. Most tools allow you to install
132129
groups using `--group`, like `pip` (25.1+), `uv pip`, and the high level `uv`
133-
interface. You do not need to install the package, though usually you do (the
134-
high level `uv` interface does). Nox, Tox, and cibuildwheel all support groups
135-
too. The `dependency-groups` package provides tools to get the dependencies,
136-
too.
130+
interface. It's possible to install a package's dependency group without
131+
installing the package itself, but usually you'll want to instruct your tool to
132+
install both (the high level `uv` interface does this automatically).
133+
Nox, Tox, and cibuildwheel all support groups, too. The `dependency-groups`
134+
package also provides tools to get the dependencies.
137135

138136
[metadata]: https://packaging.python.org/en/latest/specifications/core-metadata/
139137
[trove classifiers]: https://pypi.org/classifiers/

0 commit comments

Comments
 (0)