Skip to main content

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 evaluates a marker against one environment. nab-markersets checks whether markers overlap, whether one implies another, and whether a marker is contradictory.

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 all supported environments and a contradiction as no environments. It can also represent complements that PEP 508 cannot serialize. witness() finds a matching environment or returns None if the search finds none. Use is_empty() to prove emptiness.

>>> 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

pip install nab-markersets

The marker algebra uses the marker parser and evaluator from packaging 26.4 or newer.

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.conversions  MarkerSetCache, PreparedMarkerSets
nab_markersets.errors       IntractableMarkerSet, UnserializableMarkerSet
nab_markersets.markersets   DecisionStore, MarkerSet, factor_membership_marker, variable_names

The package root binds no names, so importing nab_markersets pulls in no submodules.

MarkerSet.from_marker_with_variables returns a set and its original variable names from one parse. Names include variables removed by normalization.

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.31

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nab-markersets 0.0.31
File Size Uploaded Provenance Actions
nab_markersets-0.0.31.tar.gz 109.3 kB With provenance Details for nab_markersets-0.0.31.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nab-markersets 0.0.31
File Interpreter ABI Platform Actions
nab_markersets-0.0.31-py3-none-any.whl Python 3 none any Details for nab_markersets-0.0.31-py3-none-any.whl

Total release size: 153.6 kB

Release files / nab_markersets-0.0.31.tar.gz

Download URL nab_markersets-0.0.31.tar.gz
Size 109.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7cf69ea8387039ce2ac3c9445a8a987163ca0fa91b3a001c4045433600447a9e
BLAKE2b-256 checksum
How to use checksums
60e520a1bbac305afc07742411d86366e5a17f6013a92d76c72acb41e087fd47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Release files / nab_markersets-0.0.31-py3-none-any.whl

Download URL nab_markersets-0.0.31-py3-none-any.whl
Size 44.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed3324e2e75d8fb39d8471c07f60153de55eaca32f6d9422c43f0f76421b0c11
BLAKE2b-256 checksum
How to use checksums
3dac411cba5f5285a9bfa3f4725d9372816a0e1c7c9c69d92c2995163a80e029
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Security for nab-markersets 0.0.31

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nab_markersets-0.0.31.tar.gz

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 Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page