python-nab-markersets
Port variant v14
Summary PEP 508 marker algebra (3.14)
Package version 0.0.16
Homepage https://github.com/notatallshaw/nab
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants v13
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 03 SEP 2026, 05:14:07 UTC
Port created 03 SEP 2026, 05:14:07 UTC
Subpackage Descriptions
single # nab-markersets A PEP 508 marker read as the set of environments it selects. `packaging` answers "does this marker hold here"; this answers "can these two ever both hold", "does one imply the other", and "is this a contradiction". **Experimental.** Anything here can change in any release, so pin an exact version. The intent is to land this algebra in `packaging` itself, and the shape below is what that proposal is being tried against; the discussion is [pypa/packaging#448]. ```pycon >>> from nab_markersets.markersets import MarkerSet >>> old = MarkerSet.from_marker('python_version < "3.11"') >>> new = MarkerSet.from_marker('python_version >= "3.12"') >>> old.is_disjoint(new) True ``` A set also holds what a marker string cannot: the full set of an absent marker, the empty set of a contradiction, and complements the grammar cannot spell. `witness` returns a point in the set, which is what separates two markers that look like one constraint. ```pycon >>> minor = MarkerSet.from_marker('python_version >= "3.11"') >>> exact = MarkerSet.from_marker('python_full_version >= "3.11.0"') >>> minor.equivalent(exact) False >>> (minor & ~exact).witness()["python_full_version"] '3.11.0.dev0' ``` ## Installing The engine runs on `packaging`'s parse tree and its single-atom evaluator, and two copies of `packaging` exist: the released one, and the fork [`nab`] vendors. An extra picks which. ```bash pip install "nab-markersets[packaging]" pip install "nab-markersets[nab-vendored-packaging]" ``` The first copy at `packaging>=26.3` is bound, so with both installed the fork wins and a `Marker` built inside nab keeps the class the algebra tests against. A `Marker` from the other copy is accepted too. With nothing that new, importing `nab_markersets.markersets` fails and says what it found. ## When to use it Whether two lock entries can both apply, whether a dependency is reachable inside your `requires-python`, or what a marker still says once you fix the platform. The guide walks through those, and through what the decisions do not decide: ## The public API The supported API is the module paths below. Everything else in the package is internal and may be renamed or relocated in any release. ```text nab_markersets.errors IntractableMarkerSet, UnserializableMarkerSet nab_markersets.markersets DecisionStore, MarkerSet, variable_names ``` The package root binds no names, so importing `nab_markersets` pulls in no submodules. Two things before you call it. A `MarkerSet` comes from `from_marker`, `full` or `empty`, so `pickle.loads` fails on one: the constructor it reaches for refuses. And `==` is structural, over the tree the set was built from, where `equivalent` is the semantic test.
Configuration Switches (platform-specific settings discarded)
PY313 OFF Build using Python 3.13 PY314 ON Build using Python 3.14
Package Dependencies by Type
Build (only) python314:dev:std
python-pip:single:v14
autoselect-python:single:std
Build and Runtime python314:primary:std
Download groups
main mirror://PYPIWHL/e1/36/c095d5fef21fd6075cf15ee1d78e98840d2d11061c5ec1b5bfc1ee2a8644
Distribution File Information
a53985601a56cb1cec3d23180cdb36e9a16e9957d36f6f1dad98dcbefbd919b6 31226 python-src/nab_markersets-0.0.16-py3-none-any.whl
Ports that require python-nab-markersets:v14
python-nab-provider:v14 IO-free resolution core for nab (3.14)