Skip to content

Conversation

@ncoghlan
Copy link
Member

@ncoghlan ncoghlan commented Jan 10, 2026

Preparation for the release of packaging 25.1 revealed multiple deficiencies in the specification of environment marker evaluation. Review of the proposed amendments to resolve those deficiencies highlighted multiple other problems, including some dating from the original PEP 508 specification:

  • other pages still referencing PEP 508 instead of the living spec
  • direct reference to PEP 685 instead of the core metadata spec
  • the "extra" special case not being properly defined
  • lacking guidance to tool developers regarding what should be considered errors to disallow entirely vs issues to work around

Inspired by the initial PR at #1971


📚 Documentation preview 📚: https://python-packaging-user-guide--1988.org.readthedocs.build/en/1988/

ncoghlan and others added 2 commits January 10, 2026 16:33
Preparation for the release of packaging 25.1 revealed multiple
deficiencies in the specification of environment marker evaluation.
Review of the proposed amendments to resolve those deficiencies
highlighted multiple other problems, including some dating from the
original PEP 508 specification:

* other pages still referencing PEP 508 instead of the living spec
* direct reference to PEP 685 instead of the core metadata spec
* the "extra" special case not being properly defined
* lacking guidance to tool developers regarding what should be
  considered errors to disallow entirely vs issues to work around

Inspired by the initial PR at pypa#1971
emit an error if the user supplied constant cannot be parsed as a valid version
specifier, while locking and installation tools MAY either emit an error or else
fall back to ``String`` field comparison logic if either the marker field value
or the user supplied constant cannot be parsed as a valid version specifier.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to note that in and not in aren't valid for version fields.

precedence (with all comparison operations having a higher precedence).

Python's comparison chaining (such as ``3.4 < python_version < 3.9``) is NOT
supported in environment markers.
Copy link
Member Author

@ncoghlan ncoghlan Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a couple of examples here, such as checking for SMP in the platform description after constricting the platform to Linux, or checking for a minimum macOS version.

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.

1 participant