Skip to main content

Intro

GitHub Actions PyPI version Python versions uv Nox Ruff Type checked with mypy Python Blueprint

nox-uv is a simple drop-in replacement for nox's @nox.session that installs dependencies constrained by uv's lockfile.

Usage

Add nox-uv as a development dependency. The following example adds it into a nox dependency-group.

uv add --group nox nox-uv

Using the following configuration within pyproject.toml as an example:

[dependency-groups]
nox = [
    "nox-uv",
]
test = [
    "pytest",
    "pytest-cov",
]
type_check = [
    "mypy",
]
lint = [
    "ruff",
]

Within, your noxfile.py:

  1. Import session from nox_uv.
  2. Set venv_backend to "uv". This can be done globally using options.default_venv_backend = "uv".
  3. Use the new uv_* parameters to session to control which dependencies are synced into the session's virtual environment in addition to the project's main dependencies.
    • uv sync is used to install dependencies so that their versions are constrained by uv.lock.
    • By default (configurable with the uv_sync_locked parameter), uv.lock is also validated to be up to date.
from nox import Session, options
from nox_uv import session

options.default_venv_backend = "uv"


@session(
    python=["3.11", "3.12", "3.13", "3.14", "3.15"],
    uv_groups=["test"],
)
def test(s: Session) -> None:
    s.run("python", "-m", "pytest")


@session(uv_groups=["type_check"])
def type_check(s: Session) -> None:
    s.run("mypy", "src")


@session(uv_only_groups=["lint"])
def lint(s: Session) -> None:
    s.run("ruff", "check", ".")
    s.run("ruff", "format", "--check", ".")

Added parameters

  • uv_groups: list of uv dependency-groups
  • uv_extras: list of uv optional-dependencies
  • uv_only_groups: list of uv only-groups to include. Prevents installation of project dependencies
  • uv_all_extras: boolean to install all optional-dependencies from pyproject.toml
  • uv_no_extras: list of extras to exclude during install of uv_all_extras
  • uv_all_groups: boolean to install all dependency-groups
  • uv_no_groups: list of groups to exclude during install of uv_all_groups
  • uv_no_install_project: boolean to not install the current project
  • uv_packages: list of uv packages to install, only valid in a uv workspace.
  • uv_all_packages: boolean to install all uv packages, only valid in a uv workspace.
  • uv_sync_locked: boolean to validate that uv.lock is up to date
  • uv_quiet: boolean to silence uv sync command

Inspiration

This is heavily influenced by, but much more limited than, nox-poetry.

Metadata

Release files for nox-uv 0.8.2

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

Source distribution (sdist)

Source distribution for nox-uv 0.8.2
File Size Uploaded Provenance Actions
nox_uv-0.8.2.tar.gz 6.0 kB Without provenance Details for nox_uv-0.8.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nox-uv 0.8.2
File Interpreter ABI Platform Actions
nox_uv-0.8.2-py3-none-any.whl Python 3 none any Details for nox_uv-0.8.2-py3-none-any.whl

Total release size: 11.7 kB

Release files / nox_uv-0.8.2.tar.gz

Download URL nox_uv-0.8.2.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
81b752a628effb60486b27271d0a9d738719285826f1129ba5869e67649992b4
BLAKE2b-256 checksum
How to use checksums
8b4fb73e07a5c6ad00d2e1e355970442458fc17e6d758b056e7f3d32d67d3bc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nox_uv-0.8.2-py3-none-any.whl

Download URL nox_uv-0.8.2-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d38f18cd0382447b297db0fc0e63178cc370123200af185c5f8e72546045c97
BLAKE2b-256 checksum
How to use checksums
7d88e21f8777fb01c76020a13db4a3de896e4885abb6b0d3376301ae65da091e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for nox-uv 0.8.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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