Skip to content

Latest commit

 

History

History
71 lines (50 loc) · 1.49 KB

File metadata and controls

71 lines (50 loc) · 1.49 KB

uv

uv is a fast Python package and project manager written in Rust. It is a single tool to replace pippip-toolspipxpoetrypyenvtwinevirtualenv, and more.

Installation

Standalone installers:

# On macOS and Linux.
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows.
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Or, from PyPI with pipx:

pipx install uv

If installed via the standalone installer, uv can update itself to the latest version:

uv self update

Projects

See the project documentation

$ uv init example
Initialized project `example` at `/home/user/example`

$ cd example

$ uv add ruff
Creating virtual environment at: .venv
Resolved 2 packages in 170ms
   Built example @ file:///home/user/example
Prepared 2 packages in 627ms
Installed 2 packages in 1ms
 + example==0.1.0 (from file:///home/user/example)
 + ruff==0.5.0

$ uv run ruff check
All checks passed!

$ uv lock
Resolved 2 packages in 0.33ms

$ uv sync
Resolved 2 packages in 0.70ms
Audited 1 package in 0.02ms

Scripts

See the scripts documentation

# Add the requests module to the script
uv add --script example.py requests

# Run the script in an isolated environment
uv run example.py