PubGrub-based dependency resolver for Python packages
Actively maintained. Last release 6 days ago, commits in 26 of the last 26 weeks. A safe choice.
pip install nabnab
nab generates universal lockfiles for Python projects. Declare your target Python versions and
platforms in pyproject.toml, then write one PEP 751 pylock.toml covering them. An installer such
as pip installs the dependencies selected for its environment from that file.
nab is written in Python and is experimental. It resolves dependencies and can download artifacts; it does not install packages or manage virtual environments.
Documentation · What nab locks · First universal lock
Install
pipx install nab
nab --version
Or install with uv:
uv tool install nab
nab runs on CPython 3.10 and newer. See installation options.
Example project
Save this as pyproject.toml in a new directory:
[project]
name = "example"
version = "0.1.0"
requires-python = ">=3.12,<3.16"
dependencies = ["requests>=2,<3"]
[tool.nab.matrix]
python = ">=3.12,<3.16"
platforms = ["linux_x86_64", "macos_arm64"]
Generate the lock:
nab lock pyproject.toml
Or use uvx nab lock pyproject.toml without installing nab first. This writes one lock for Python
3.12, 3.13, 3.14 and 3.15 on Linux x86-64 and Apple Silicon macOS.
Install from it in a covered virtual environment with pip 26.1 or newer:
python -m pip install -r pylock.toml
In nab, you choose which Python versions, platforms and interpreter implementations to resolve universally, because explicit is better than implicit. See the tutorial for a walkthrough and target configuration for other targets.
Safer defaults
pip and uv can run a downloaded package's build backend just to discover its dependencies. nab makes remote builds opt-in, reducing code execution during locking.