poetry
poetry copied to clipboard
docs: document `python` and `platform` dependency shorthands
Closes #9183
What
Adds a python and platform shorthands subsection to the Using environment markers part of the dependency-specification docs.
Why
The marker docs document the markers property but never document the python and platform shorthand keys available on long-form [tool.poetry.dependencies] entries, nor how they combine with an explicit markers value (the issue's three asks).
The new subsection covers:
python→ a version constraint onpython_version(e.g.python = "^3.9"⇒python_version >= "3.9" and python_version < "4.0").platform→ an exact match onsys_platform(e.g.platform = "darwin").- That they are not deprecated, just shorthands, and that combining them with
markersjoins all conditions withand(with a worked example). - That they are only available in the legacy
[tool.poetry.dependencies]table; the PEP 621[project]table uses inline PEP 508 markers instead.
Scoped to documenting current behavior. Docs-only change.
Thanks for the review @sourcery-ai!
platformvalues: clarified that the value is the rawsys.platformstring (commonlydarwin,win32,linux) and not a friendly name likemacOS, with a link to the CPythonsys.platformdocs.- PEP 621
[project]table: the section already notes these shorthands are legacy-table-only and shows the equivalent inline PEP 508 marker for[project], so readers have the preferred alternative inline.
Pushed in 563a5cb.