Resources

Capability Comparison: uv vs Poetry

CapabilityuvPoetry
Dependency resolution
Dependency installation✅ (very fast)
Lockfile✅ (uv.lock)✅ (poetry.lock)
Virtual environment management
Uses pyproject.toml
Project scaffolding
CLI tool installation✅ (uv tool, uvx)
Package building
Package publishing (PyPI / private registry)
Opinionated all-in-one workflow
Speed (resolver + installer)⭐⭐⭐⭐⭐⭐⭐⭐

NOTE

  • uv focuses on ultra-fast dependency and environment management and intentionally does not handle package publishing.
  • Poetry is an all-in-one project tool that also supports building and publishing Python packages to PyPI or private registries.

A practical, modern default stack for most Python projects (apps, APIs, data/LLM work):

  • uv — dependency + venv management (fast installs, lockfile)
  • ruff — formatting + linting (fast; replaces black/isort/flake8 in many setups)
  • pytest — testing
  • mypy — optional static typing (especially useful as projects grow)
  • pre-commit — run ruff/pytest (and others) automatically on commits

Quick start (commands)

Install core dev tools (as project deps):

uv add --dev ruff pytest

Optional typing + pre-commit:

uv add --dev mypy pre-commit

Install ruff as a global CLI tool (optional alternative to project dev dep):

uv tool install ruff

Set up pre-commit (if you added it):

pre-commit install

Notes

  • For libraries you plan to publish, add build + twine (or use Poetry) for packaging/publishing.
  • If you use Jupyter heavily, consider uv add --dev ipykernel and/or jupyterlab.

Useful Commands

Creating a Project

For more details, visit Working on Projects

Create a new Python project

$ uv init new-ap

Alternatively, you can initialize a project in the working directory:

$ uv init

uv will create the following files:

├── .gitignore
├── .python-version
├── README.md
├── main.py
└── pyproject.toml

Run the main file/script

$ uv run main.py

Managing Dependencies

Add dependencies

$ uv add requests

Remove a package

$ uv remove requests

Visualise dependencies

$ uv tree

Running Commands

Manually update the environment

$ uv sync

Tools

Tools are Python packages that provide command-line interfaces.

For more details, visit Tools

Install a tool

$ uv tool install ruff

Check the specific tool

$ which ruff

Check the list of tools installed

$ uv tool list

Use the tool

$ ruff format
$ ruff check

Use the tool without installation

$ uvx ruff format
$ uvx ruff check