Skip to contents

Project lifecycle

Initialise and manage uv projects.

init()
Initialise a uv project
add()
Add dependencies to a uv project
lock()
Resolve and validate project dependencies
sync()
Synchronise project dependencies using uv
venv()
Create or update a Python virtual environment

Tools

Run Python tools in isolated environments.

uv()
Call uv using structured command semantics
uvx()
Run a Python tool in an isolated environment using uvx
pip_install()
Install Python packages using uv

Python

Inspect the Python interpreter managed by uv.

python()
Get Python interpreter used by uv
python_version()
Get Python version used by uv

Project introspection

Query and validate project structure.

uses_project()
Check whether a uv project is present
has_venv()
Check whether a local uv environment exists
project_root()
Find the uv project root
pyproject_path()
Locate the pyproject.toml file for a uv project
check_lock()
Check if lockfile is up-to-date
check_project()
Require a uv project
lock_exists()
Check if lockfile exists
lock_path()
Get the path to the lockfile
uv_path()
Locate the uv executable
uv_version()
Get the installed uv version string
uv_version_number()
Get the installed uv version number

Installation

Install and remove the uv binary.

available()
Check whether uv is available
install_uv()
Install the uv Python package manager
uninstall_uv()
Uninstall uv

Testing helpers

Utilities for writing tests and examples.

with_temp_project()
Run code inside a temporary uv project workspace
with_project_root()
Run code with the working directory set to the uv project root