Nox-UV Integration

0.7.1 · active · verified Thu Apr 16

Nox-UV facilitates the integration of `uv`, a fast Python package installer and resolver, into `nox` sessions. It streamlines dependency management and session setup for testing, linting, and other development tasks, leveraging `uv`'s performance benefits. The current version is 0.7.1, and the library maintains an active development pace with frequent updates.

Common errors

Warnings

Install

Imports

Quickstart

Create a `noxfile.py` in your project root. The `uvsession` decorator replaces `nox.session` and automatically uses `uv` for package management within the session. The `session.install` command will then utilize `uv`.

import nox
from nox_uv import uvsession

@uvsession(python=["3.9", "3.10", "3.11", "3.12"])
def test(session: uvsession):
    # Installs project and test dependencies using uv
    session.install("-e", ".[test]")
    session.run("pytest", *session.posargs)

@uvsession(python="3.12")
def lint(session: uvsession):
    # Installs ruff using uv
    session.install("ruff")
    session.run("ruff", "check", ".")
    session.run("ruff", "format", "--check", ".")

view raw JSON →