@@ -211,7 +211,7 @@ marker variable, ``sys_abi_info``, is added to the format of dependency
211211specifiers. It is built to reflect the value of :data: `sys.abi_info `, which is a
212212new attribute of the ``sys `` module introduced in Python 3.15 as a simple
213213namespace. To represent its fields in the environment marker variable, they are
214- expressed as a frozen set of strings of the form ``f"{name}::{value}" ``, where
214+ expressed as a set of strings of the form ``f"{name}::{value}" ``, where
215215``name `` is the name of the field and ``value `` is the string representation of
216216its value.
217217
@@ -243,22 +243,40 @@ Like the grammar, also the overview table of environment markers in
243243
244244 * - Marker
245245 - Python equivalent
246+ - Type
246247 - Sample values
247248 * - ``sys_abi_info ``
248249 - :data: `sys.abi_info `
250+ - Set of strings
249251 - ``{'free_threaded::True', 'debug::False', 'pointer_bits::64', 'byteorder::little'} ``,
250252 ``{'free_threaded::False', 'debug::True', 'pointer_bits::32', 'byteorder::little'} ``,
251253 ``{'free_threaded::False', 'debug::False', 'pointer_bits::64', 'byteorder::little'} ``
252254
253255With these additions, ABI features can be used in dependency specifications via
254256the ``in `` operator to test for the presence of a feature-value pair, or the
255- ``not in `` operator to test for its absence.
257+ ``not in `` operator to test for its absence. As for the other
258+ ``Set of strings `` marker fields, these are the only valid operations, and the
259+ existing rules of the dependency specifiers specification for the use of other
260+ comparison operators with such fields apply unchanged.
256261
257262This allows for marker expressions such as::
258263
259264 "free_threaded::True" in sys_abi_info
260265 "pointer_bits::32" not in sys_abi_info and "debug::True" in sys_abi_info
261266
267+ In the quoted string of such a test, spaces and tabs directly adjacent to the
268+ ``:: `` separator are ignored, so that ``"pointer_bits :: 32" in sys_abi_info ``
269+ is equivalent to ``"pointer_bits::32" in sys_abi_info ``. This is the only
270+ exception to the treatment of the elements of a ``Set of strings `` field as
271+ opaque strings. In all other respects, the comparison is defined as it is for
272+ string fields in the dependency specifiers specification, that is, it is case
273+ sensitive, with no value normalization of any kind. In particular, all other
274+ whitespace, including leading and trailing whitespace of the string as a whole
275+ and whitespace within a name or a value, is significant. A string that as a
276+ result matches no element of ``sys_abi_info `` is simply absent from the set;
277+ it is not an error. The elements of ``sys_abi_info `` themselves are
278+ constructed by the tool and contain no whitespace around the separator.
279+
262280Integer-valued features support exact-value tests, not numerical comparisons.
263281This is sufficient for the bitness use case: excluding 32-bit Windows requires
264282testing for ``"pointer_bits::32" ``, without enumerating other possible pointer
@@ -278,7 +296,9 @@ ABI feature values MUST be unambiguously representable as strings. Currently,
278296all ABI features are either booleans, integers, or strings, which all satisfy
279297this requirement. This is expected to remain the case. When constructing
280298``sys_abi_info ``, packaging tools MUST ignore fields whose values have other
281- data types.
299+ data types. If this affects one of the features that tools are required to
300+ provide, the field is treated as absent and its value is determined by the
301+ rules in `Determining ABI Features on Older Interpreters `_.
282302
283303Core Metadata
284304-------------
@@ -491,6 +511,49 @@ Once tools understand ``sys_abi_info``, additional values in its set can be
491511handled through the membership semantics specified above. Unknown marker
492512*fields * must not be confused with absent or unknown ABI feature *values *.
493513
514+ Serialized Marker Environments
515+ ------------------------------
516+
517+ Some tools serialize the marker environment of an interpreter, for example
518+ ``pip inspect `` and the installation report written by
519+ ``pip install --report ``, both of which are documented formats consumed by
520+ other tools, and ``pdm info --env ``. Until now, every value in the default
521+ marker environment has been a string. ``sys_abi_info `` is the first value that
522+ is a set, which affects both sides of such an interface: producers need to
523+ convert it, because, for example, Python's :mod: `json ` module does not
524+ serialize sets, and consumers can no longer assume that every value is a
525+ string. Pex is an example of both: ``pex3 interpreter inspect --markers ``
526+ writes the marker environment of an interpreter as JSON, and the
527+ ``--complete-platform `` option reads such a file back to describe a target
528+ that Pex resolves for, expecting a fixed set of string-valued fields.
529+
530+ The same applies to tools that evaluate markers for an interpreter other than
531+ the one they run in. Such tools typically determine the marker environment by
532+ running a small probe in the target interpreter and passing the result back
533+ across a process boundary. The probe needs to compute ``sys_abi_info ``
534+ according to the rules in this PEP, and any validation of the result that
535+ assumes a fixed set of keys or string values, as ``tox `` performs, needs to be
536+ updated.
537+
538+ We recommend that tools that serialize a marker environment to JSON represent
539+ ``sys_abi_info `` as an array of its strings in sorted order, for example::
540+
541+ "sys_abi_info": ["byteorder::little", "debug::False", "free_threaded::False", "pointer_bits::64"]
542+
543+ This uses the same strings as the marker itself, so a consumer can load the
544+ array into a set and evaluate markers against it directly, and sorting makes
545+ the output deterministic.
546+
547+ The alternative of a single delimited string, such as
548+ ``"byteorder::little,debug::False,..." ``, would keep every value in the
549+ environment a string, and would therefore not affect consumers that rely on
550+ that. However, it would introduce a delimiter, and with it a question of
551+ escaping, that this PEP does not otherwise need, and it would require every
552+ consumer to split the string before use.
553+
554+ Tools that produce or consume serialized marker environments may lose
555+ functionality until they implement support for set-valued marker fields.
556+
494557Audit and Update Tools
495558----------------------
496559
@@ -603,6 +666,19 @@ served as a template for the corresponding section in this PEP.
603666Change History
604667==============
605668
669+ - 20-Nov-2026
670+
671+ - Specified the handling of whitespace in the strings tested against
672+ ``sys_abi_info ``: spaces and tabs adjacent to the ``:: `` separator are
673+ ignored, all other whitespace is significant.
674+ - Declared the type of ``sys_abi_info `` as a set of strings in the table of
675+ environment markers.
676+ - Clarified that a required feature whose ``sys.abi_info `` field has an
677+ unsupported type is determined by the rules for older interpreters.
678+ - Added a recommendation for representing ``sys_abi_info `` when a marker
679+ environment is serialized to JSON, and discussed the impact on tools
680+ that produce or consume such output.
681+
606682- 05-Nov-2026
607683
608684 - Rewrote `Backwards Compatibility `_ and clarified how installation and
0 commit comments