Skip to content

Commit 2516335

Browse files
authored
docs: add dependency-groups example with include-group (#10543)
1 parent 985449a commit 2516335

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/managing-dependencies.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,26 @@ special care should be taken to ensure they are compatible with each other.
120120
You can include dependencies from one group in another group.
121121
This is useful when you want to aggregate dependencies from multiple groups into a single group.
122122

123+
{{< tabs tabTotal="2" tabID1="group-include-pep735" tabID2="group-include-poetry" tabName1="[dependency-groups]" tabName2="[tool.poetry]">}}
124+
125+
{{< tab tabID="group-include-pep735" >}}
126+
```toml
127+
[dependency-groups]
128+
test = [
129+
"pytest (>=8.0.0,<9.0.0)",
130+
]
131+
lint = [
132+
"ruff (>=0.11.0,<0.12.0)",
133+
]
134+
dev = [
135+
{ include-group = "test" },
136+
{ include-group = "lint" },
137+
"tox",
138+
]
139+
```
140+
{{< /tab >}}
141+
142+
{{< tab tabID="group-include-poetry" >}}
123143
```toml
124144
[tool.poetry.group.test.dependencies]
125145
pytest = "^8.0.0"
@@ -136,6 +156,8 @@ include-groups = [
136156
[tool.poetry.group.dev.dependencies]
137157
tox = "*"
138158
```
159+
{{< /tab >}}
160+
{{< /tabs >}}
139161

140162
In this example, the `dev` group includes all dependencies from the `test` and `lint` groups.
141163

0 commit comments

Comments
 (0)