{"id":7456,"library":"nox-uv","title":"Nox-UV Integration","description":"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.","status":"active","version":"0.7.1","language":"en","source_language":"en","source_url":"https://github.com/dantebben/nox-uv","tags":["nox","uv","testing","development","virtualenv","packaging","dependency-management"],"install":[{"cmd":"pip install nox-uv","lang":"bash","label":"Install Nox-UV"}],"dependencies":[{"reason":"Core testing automation tool that nox-uv extends.","package":"nox","optional":false},{"reason":"The underlying package installer and resolver nox-uv integrates with. Must be available in the environment.","package":"uv","optional":false}],"imports":[{"note":"The `uvsession` decorator is the primary entry point and is directly imported from the top-level package.","wrong":"import nox_uv.uvsession","symbol":"uvsession","correct":"from nox_uv import uvsession"}],"quickstart":{"code":"import nox\nfrom nox_uv import uvsession\n\n@uvsession(python=[\"3.9\", \"3.10\", \"3.11\", \"3.12\"])\ndef test(session: uvsession):\n    # Installs project and test dependencies using uv\n    session.install(\"-e\", \".[test]\")\n    session.run(\"pytest\", *session.posargs)\n\n@uvsession(python=\"3.12\")\ndef lint(session: uvsession):\n    # Installs ruff using uv\n    session.install(\"ruff\")\n    session.run(\"ruff\", \"check\", \".\")\n    session.run(\"ruff\", \"format\", \"--check\", \".\")\n","lang":"python","description":"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`."},"warnings":[{"fix":"Install `uv` globally (`pip install uv` or `cargo install uv`) or ensure it's part of your base Nox environment setup.","message":"The `uv` executable must be installed and accessible in the system's PATH or within the Nox virtual environment. `nox-uv` is a bridge, not a `uv` installer.","severity":"gotcha","affected_versions":"All"},{"fix":"Review your `session.install` calls involving `extras` (e.g., `.[dev,test]`). Consult the documentation for the correct syntax for your `nox-uv` version, especially regarding exclusions.","message":"Handling of project `extras` changed significantly in v0.3.0 (removed arbitrary extras) and was refined in v0.7.0 (allowing exclusion of specific groups). Old `session.install` calls might behave differently.","severity":"breaking","affected_versions":"0.3.0, 0.7.0"},{"fix":"Upgrade to `nox-uv` v0.7.1 or higher to use the `uv_quiet=True` option in your `@uvsession` decorator.","message":"From v0.7.1, a `uv_quiet` option was added to suppress `uv sync` output for cleaner logs. If you're missing this option, you're on an older version.","severity":"gotcha","affected_versions":"<0.7.1"},{"fix":"If upgrading to v0.6.0 or later, consider adding `uv_no_project_install=True` to your `@uvsession` decorator if your `session.install(\".\")` or `session.install(\"-e\", \".\")` calls are unintentional for that session.","message":"For scenarios where the current project should *not* be installed into the session's environment, use `uv_no_project_install=True`.","severity":"gotcha","affected_versions":"<0.6.0"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Install `uv` using `pip install uv` (if you have pipx) or `cargo install uv`. Ensure its installation directory is in your PATH.","cause":"The `uv` executable is not installed or not available in the system's PATH.","error":"uv: command not found"},{"fix":"Add `from nox_uv import uvsession` to the top of your `noxfile.py`.","cause":"The `uvsession` decorator was not correctly imported from `nox_uv`.","error":"NameError: name 'uvsession' is not defined"},{"fix":"Ensure `@uvsession` is placed directly above your session function definition (e.g., `@uvsession(...) def mysession(...)`).","cause":"You are using `uvsession` as a regular function call instead of a decorator.","error":"nox.session must be passed as a decorator."},{"fix":"`uv` is expected to be present in the environment where Nox runs. Do not attempt to install `uv` *within* a `nox-uv` managed session.","cause":"You might be trying to install `uv` itself using `session.install('uv')` inside a `nox-uv` session. `uv` needs to be globally available or managed outside the specific session.","error":"nox.virtualenv.VirtualEnv.install: uv is not a valid dependency name or path."}]}