docs: document python and platform dependency shorthands#10952
Open
rumitvn wants to merge 1 commit into
Open
Conversation
The environment-markers section did not document the python and platform shorthand keys for long-form [tool.poetry.dependencies] entries, nor how they combine with an explicit markers value. Add a subsection covering both shorthands, their marker equivalents, the and-combining semantics, and the PEP 621 [project] alternative. Closes python-poetry#9183
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Since
platformis described as an exact match onsys_platform, consider briefly clarifying what values Poetry expects there (e.g.darwin,win32,linux) or linking to where those canonical values are documented to avoid confusion with things likemacOS. - You describe
[tool.poetry.dependencies]as the "legacy" table; it might help readers if you either link to or briefly reference the section explaining the preferred PEP 621[project]usage so they can understand when to use each.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Since `platform` is described as an exact match on `sys_platform`, consider briefly clarifying what values Poetry expects there (e.g. `darwin`, `win32`, `linux`) or linking to where those canonical values are documented to avoid confusion with things like `macOS`.
- You describe `[tool.poetry.dependencies]` as the "legacy" table; it might help readers if you either link to or briefly reference the section explaining the preferred PEP 621 `[project]` usage so they can understand when to use each.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9183
What
Adds a
pythonandplatformshorthands subsection to the Using environment markers part of the dependency-specification docs.Why
The marker docs document the
markersproperty but never document thepythonandplatformshorthand keys available on long-form[tool.poetry.dependencies]entries, nor how they combine with an explicitmarkersvalue (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").markersjoins all conditions withand(with a worked example).[tool.poetry.dependencies]table; the PEP 621[project]table uses inline PEP 508 markers instead.Scoped to documenting current behavior. Docs-only change.