Skip to content

Commit 5cc773c

Browse files
committed
docs: add docs about include-groups
1 parent 5dc292b commit 5cc773c

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

docs/managing-dependencies.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,30 @@ Optional group dependencies will **still** be resolved alongside other dependenc
8080
special care should be taken to ensure they are compatible with each other.
8181
{{% /warning %}}
8282

83+
### Including Dependencies from Other Groups
84+
85+
You can include dependencies from one group in another group.
86+
This is useful when you want to aggregate dependencies from multiple groups into a single group.
87+
88+
```toml
89+
[tool.poetry.group.test.dependencies]
90+
pytest = "^6.0.0"
91+
92+
[tool.poetry.group.lint.dependencies]
93+
black = "^20.8b1"
94+
95+
[tool.poetry.group.dev]
96+
include-groups = [
97+
"test",
98+
"lint"
99+
]
100+
101+
[tool.poetry.group.dev.dependencies]
102+
tox = "*"
103+
```
104+
105+
In this example, the `dev` group includes all dependencies from the `test` and `lint` groups.
106+
83107
### Adding a dependency to a group
84108

85109
The [`add`]({{< relref "cli#add" >}}) command is the preferred way to add dependencies

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "2.0.1"
44
description = "Python dependency management and packaging made easy."
55
requires-python = ">=3.9,<4.0"
66
dependencies = [
7-
"poetry-core @ git+https://github.com/python-poetry/poetry-core.git",
7+
"poetry-core @ git+https://github.com/finswimmer/core.git@nested-dependency-groups",
88
"build (>=1.2.1,<2.0.0)",
99
"cachecontrol[filecache] (>=0.14.0,<0.15.0)",
1010
"cleo (>=2.1.0,<3.0.0)",

0 commit comments

Comments
 (0)