Skip to content

Commit b14fad0

Browse files
docs: update Poetry dependency groups for PEP 735 (#824)
* update Poetry dependency groups for PEP 735 * update package-structure-code/python-package-build-tools.md --------- Co-authored-by: Inessa Pawson <inessapawson@gmail.com>
1 parent a0a1175 commit b14fad0

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎package-structure-code/python-package-build-tools.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,7 @@ Build your sdist and wheel distributions|✅|Poetry will build your sdist and wh
414414

415415
Some challenges of Poetry include:
416416

417-
- Poetry has its own concept of grouped dependencies (`poetry add --group=GROUP_NAME DEPENDENCY`). Dependencies added as grouped dependencies are not optional and there is no Python standard for this type of dependency. This should not be confused with "optional" dependencies (`poetry add --optional=GROUP_NAME DEPENDENCY`), which is standardised and lets you group your dependencies into several optional groups.
418-
- While Poetry supports "development" dependencies (i.e. dependencies you use for development but not running the code, such as `pytest`), Poetry does not yet follow the standardised format for specifying such dependencies.
417+
- Poetry has its own format for grouped dependencies (`[tool.poetry.group.<name>.dependencies]`), which predates the [dependency groups standard](https://packaging.python.org/en/latest/specifications/dependency-groups/) (PEP 735). Poetry 2.2 and later also support the standard `[dependency-groups]` table, which this guide suggests for [development dependencies](dependency-groups). Grouped dependencies should not be confused with "optional" dependencies (`poetry add --optional=EXTRA_NAME DEPENDENCY`), which are standardised and let you group your dependencies into several optional groups.
419418
- Poetry, by default, pins dependencies using an "upper bound" limit (which is specified with the `^` symbol in the legacy format). However, this behavior can be over-written by specifying the dependency when you use `poetry add` as follows: `poetry add "requests>=2.1"` See breakout below for more discussion on issues surrounding upper-bounds pinning.
420419

421420
Poetry is a popular packaging tool and introduced many very useful features. However, if you decide to use it, then use caution when adding dependencies as Poetry's approach to pinning can be problematic for many builds. If you use Poetry, we strongly suggest that you override the default upper bound dependency option.

0 commit comments

Comments
 (0)