nab-markersets
A dependency marker is a condition such as python_version < "3.11" that controls when a
requirement applies. This package compares PEP 508 markers as sets of environments. 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. The API can change in any release, so pin an exact version.
>>> 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
MarkerSet represents an absent marker as full, a contradiction as empty, and complements the
marker grammar cannot serialize. witness returns a point in the set, which separates two markers
that look like one constraint.
>>> 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. Two copies of packaging
exist: the released one, and the fork nab vendors. An extra picks
which.
pip install "nab-markersets[packaging]"
pip install "nab-markersets[nab-vendored-packaging]"
The first copy at version 26.3 or newer is used. The vendored fork is tried first, followed by
released packaging.
A Marker from the other copy is accepted too. If neither copy is new enough, 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 covers those
tasks and the limits of its decisions:
https://nab.readthedocs.io/en/stable/how-to/reason-about-markers.html
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.
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.
pickle.dumps can write a MarkerSet, but pickle.loads fails because direct construction is
refused. == compares construction trees; use equivalent to compare the environments two sets
select.
Metadata
Release files for nab-markersets 0.0.19
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nab_markersets-0.0.19.tar.gz | 60.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nab_markersets-0.0.19-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 91.8 kB
Release files / nab_markersets-0.0.19.tar.gz
| Download URL | nab_markersets-0.0.19.tar.gz |
|---|---|
| Size | 60.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7e7314ac8cbdfb0d025a0a5ca53eaac7a6b66059c033386832ff8d1bd0f1ba2f
|
|
BLAKE2b-256 checksum How to use checksums |
1dde03b35011370e2c27d9ee32142fcb55c793636ab4bb29a35c9e7f2ff52c34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.
Transparency logRelease files / nab_markersets-0.0.19-py3-none-any.whl
| Download URL | nab_markersets-0.0.19-py3-none-any.whl |
|---|---|
| Size | 31.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
253c54ed3e5e59bfa3cf69eac95ab08ecb333c3239b2476ef770034b194e7437
|
|
BLAKE2b-256 checksum How to use checksums |
24dfd4e499e1e0796dd7dbe78700743e0847753ba42c583cb5a489673385d085
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.
Transparency log