Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

platform release is not a version-like marker #552

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
platform release is not a version-like marker
Version like markers are validated against PEP-440. This allows things
like '1.0.0' and disallows things like '1.8.0_u60'. However, this is
very valid in platform_release, as described in
[PEP-508](https://peps.python.org/pep-0508/#environment-markers)
which gives samples `3.14.1-x86_64-linode39, 14.5.0, 1.8.0_51`.

platform_release should be a normal marker, which I think allows for
equality checking only.

This fixes #7418 where I was guided towards this solution.
  • Loading branch information
j-baker committed Jan 30, 2023
commit 001a3b458893c53053b89879cce7adff7a196f5b
1 change: 0 additions & 1 deletion src/poetry/core/version/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ class SingleMarker(BaseMarker):
_VERSION_LIKE_MARKER_NAME = {
"python_version",
"python_full_version",
"platform_release",
}

def __init__(
Expand Down
4 changes: 2 additions & 2 deletions tests/version/test_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,8 +902,8 @@ def test_validate(
"marker, env",
[
(
'platform_release >= "9.0" and platform_release < "11.0"',
{"platform_release": "10.0"},
'python_version >= "9.0" and python_version < "11.0"',
{"python_version": "10.0"},
)
],
)
Expand Down