Resources
Capability Comparison: uv vs Poetry
| Capability | uv | Poetry |
|---|---|---|
| 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.
Recommended Default Stack (uv-first)
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 pytestOptional typing + pre-commit:
uv add --dev mypy pre-commitInstall ruff as a global CLI tool (optional alternative to project dev dep):
uv tool install ruffSet up pre-commit (if you added it):
pre-commit installNotes
- For libraries you plan to publish, add build + twine (or use Poetry) for packaging/publishing.
- If you use Jupyter heavily, consider
uv add --dev ipykerneland/orjupyterlab.
Useful Commands
Creating a Project
For more details, visit Working on Projects
Create a new Python project
$ uv init new-apAlternatively, you can initialize a project in the working directory:
$ uv inituv will create the following files:
├── .gitignore
├── .python-version
├── README.md
├── main.py
└── pyproject.tomlRun the main file/script
$ uv run main.pyManaging Dependencies
Add dependencies
$ uv add requestsRemove a package
$ uv remove requestsVisualise dependencies
$ uv treeRunning Commands
Manually update the environment
$ uv syncTools
Tools are Python packages that provide command-line interfaces.
For more details, visit Tools
Install a tool
$ uv tool install ruffCheck the specific tool
$ which ruffCheck the list of tools installed
$ uv tool listUse the tool
$ ruff format
$ ruff checkUse the tool without installation
$ uvx ruff format
$ uvx ruff check