From f9ab92837d3e78ba0e6adb130b08bcd6ec419ad3 Mon Sep 17 00:00:00 2001 From: Colin Dean Date: Thu, 6 Oct 2022 12:47:23 -0400 Subject: [PATCH 1/2] Clarifies the dev-dependencies -> group.dev.dependencies switch As written, it seemed to prioritize the older section notation without clarifying that the older syntax still works but shouldn't be used. This reorder visually prioritizes the preferred syntax as of 1.2.x while clearly explaining what the old syntax is during this transition period. The best next step here would be a clear definition of the version in which dev-dependencies will go away. --- docs/managing-dependencies.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/managing-dependencies.md b/docs/managing-dependencies.md index c1fa129674c..1f7145b5271 100644 --- a/docs/managing-dependencies.md +++ b/docs/managing-dependencies.md @@ -59,19 +59,24 @@ use [extras]({{< relref "pyproject#extras" >}}) instead. Extras can be installed {{% /note %}} {{% note %}} -**A note about the `dev-dependencies` section** +**A note about defining a `dev` dependencies group** -Any dependency declared in the `dev-dependencies` section will automatically be added to a `dev` group. -So the two following notations are equivalent: +The proper way to define a `dev` dependencies group as of Poetry 1.2.x is the following: ```toml -[tool.poetry.dev-dependencies] +[tool.poetry.group.dev.dependencies] pytest = "^6.0.0" pytest-mock = "*" ``` +This group notation is preferred for Poetry 1.2.x and not usable in earlier versions. +For backwards compatibility with older versions of Poetry, +any dependency declared in the `dev-dependencies` section will automatically be added to the `dev` group. +So the above and following notations are equivalent: + ```toml -[tool.poetry.group.dev.dependencies] +# Poetry pre-1.2.x style, understood by Poetry 1.0–1.2 +[tool.poetry.dev-dependencies] pytest = "^6.0.0" pytest-mock = "*" ``` From 14857878d3e30f4f0c52d3137829d2cadaaaa0bd Mon Sep 17 00:00:00 2001 From: Colin Dean Date: Sun, 6 Nov 2022 09:41:49 -0500 Subject: [PATCH 2/2] Use 1.2.0 instead of 1.2.x Co-authored-by: Mathieu Kniewallner --- docs/managing-dependencies.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/managing-dependencies.md b/docs/managing-dependencies.md index 1f7145b5271..16622624857 100644 --- a/docs/managing-dependencies.md +++ b/docs/managing-dependencies.md @@ -61,7 +61,7 @@ use [extras]({{< relref "pyproject#extras" >}}) instead. Extras can be installed {{% note %}} **A note about defining a `dev` dependencies group** -The proper way to define a `dev` dependencies group as of Poetry 1.2.x is the following: +The proper way to define a `dev` dependencies group since Poetry 1.2.0 is the following: ```toml [tool.poetry.group.dev.dependencies] @@ -69,7 +69,7 @@ pytest = "^6.0.0" pytest-mock = "*" ``` -This group notation is preferred for Poetry 1.2.x and not usable in earlier versions. +This group notation is preferred since Poetry 1.2.0 and not usable in earlier versions. For backwards compatibility with older versions of Poetry, any dependency declared in the `dev-dependencies` section will automatically be added to the `dev` group. So the above and following notations are equivalent: