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

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.1
File Size Uploaded Provenance Actions
nox_uv-0.8.1.tar.gz 5.9 kB Without provenance Details for nox_uv-0.8.1.tar.gz

Built distribution (wheel)

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

Total release size: 11.5 kB

Release files / nox_uv-0.8.1.tar.gz

Download URL nox_uv-0.8.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6ec76ab3b9307ead53ba91b09872c2164b186c4ab74fe7776d1c147534575406
BLAKE2b-256 checksum
How to use checksums
3917ea51d313d00f102b8b551251e9c6be4d263ffbe665ea7f17f0f275670d71
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.1-py3-none-any.whl

Download URL nox_uv-0.8.1-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e39a2b7aca9c87619a3ea92a42c192f6b34c730d313c3f4fe425f8899d3d191
BLAKE2b-256 checksum
How to use checksums
7cca3acd31ee87050a9ff4be7ef3133b3b59e307ddef278cbf9669ed5358beff
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.1

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