Aller au contenu

Uv

De Banane Atomic

Links

Description

  • unified tool
    • package installer, replaces pip, pip-tool, pipx
    • environment manager, replace venv
    • Python version manager
    • project manager, replaces poetry
  • very fast: written in Rust

CLI

uv --version

uv python list  # list all python versions available on your system

New project

uv init [project]
uv init  # from the [project] folder if it already exists
uv init --lib [lib]  # for a lib
# create .gitignore, .python-version, main.py, pyproject.toml and README.md

Packages management

uv add [package]  # add a new package
# create the venv if needed
# update the pyproject.toml and uv.lock

uv sync  # add / remove packages regarding the pyproject.toml

Run

uv run .\main.py
# create the venv
# fetch the dependencies
# run the main.py