Skip to content

Warn when python_version markers aren't valid PEP 440 versions - #1398

Open
gyanu2507 wants to merge 2 commits into
pypa:mainfrom
gyanu2507:marker-invalid-version-warn
Open

Warn when python_version markers aren't valid PEP 440 versions#1398
gyanu2507 wants to merge 2 commits into
pypa:mainfrom
gyanu2507:marker-invalid-version-warn

Conversation

@gyanu2507

Copy link
Copy Markdown

python_version >= "3.9." isn't a PEP 440 version, so the comparison currently falls back to string compare with no indication (and "3.10" >= "3.9." is False).

Warn for < <= == != >= > on python_version / python_full_version when that happens. in / not in and platform_release are unchanged.

Fixes #633

@gyanu2507

Copy link
Copy Markdown
Author

The Downstream twine failure is also on main and isn't related to this change.

Both runs fail on the same single test with the same assertion:

FAILED tests/test_check.py::test_fails_rst_no_content - AssertionError: assert False
1 failed, 227 passed, 1 deselected

That's twine's own README-rendering check, which doesn't go through marker evaluation. main at b9d249f (perf(tests): disable more unused pytest ...) has it as its only failing check; 053c884 and earlier were green, so it started upstream of this branch.

The other 61 checks here pass.

@henryiii

henryiii commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Thanks! Fixing the CI in #1400.

@henryiii
henryiii force-pushed the marker-invalid-version-warn branch from 421b9f0 to 9eff8b5 Compare September 2, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Marker comparisons silently switches from version comparison to lexicographically

2 participants