python-nab-markersets
Port variant v15
Summary PEP 508 marker algebra (3.15)
Package version 0.0.31
Homepage https://github.com/notatallshaw/nab
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants v14
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 24 NOV 2026, 13:34:26 UTC
Port created 03 SEP 2026, 05:14:07 UTC
Subpackage Descriptions
single # 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. ```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 ``` `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. ```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 ```bash 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: ## 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.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.
Configuration Switches (platform-specific settings discarded)
PY314 OFF Build using Python 3.14 PY315 ON Build using Python 3.15
Package Dependencies by Type
Build (only) python315:dev:std
python-pip:single:v15
autoselect-python:single:std
Build and Runtime python315:primary:std
Runtime (only) python-nab-resolver:single:v15
python-packaging:single:v15
Download groups
main mirror://PYPIWHL/3d/ac/411cba5f5285a9bfa3f4725d9372816a0e1c7c9c69d92c2995163a80e029
Distribution File Information
ed3324e2e75d8fb39d8471c07f60153de55eaca32f6d9422c43f0f76421b0c11 44338 python-src/nab_markersets-0.0.31-py3-none-any.whl
Ports that require python-nab-markersets:v15
python-nab-provider:v15 Nab package candidate selector (3.15)