Skip to content

Uv

uv is a Python project manager. It consolidates functionality of many different tools into 1 convenient CLI. The tool is written in Rust, and is extremely fast. It uses a custom dependency solver so dependency search/install from Pypi is faster, too.

The tool handles the following (and more):

  • Project initialization
    • The uv init command initializes a directory path for developing Python programs.
    • It has --app and --lib options, scaffolding the directory for developing an app or library.
    • You can use the --bare option to create only a pyproject.toml file, which tracks the project’s build configuration & dependencies, but does not create any project scaffolding.
    • uv can also manage individual scripts with the --script option.
  • Virtual environments
    • When you run a uv command, a .venv/ directoy is created automatically.
    • Whenever you run a command prefixed with uv, i.e. uv python main.py, the tool will use the virtual environment’s Python/Pip.
  • Manage your Python install, allowing you to install multiple versions scoped to individual uv-managed projects.
  • Manage your project dependencies.
    • Can also install dev depenencies, which are available locally during development but are not packaged with the app.
  • uvx runs a tool in an isolated environment, i.e. uvx ruff, without installing it or adding it to the project.
Last updated on