This repo is to show how to manage project with peotry and uv togther.
Even though uv can installation, resolution, and compilation with high speed, but it does not support uv add like Poetry's poetry add, especially not with group targeting like --group dev.
Therefore, it is better to specifically apply them to dependency management tasks that they are good at
| Task | Tool |
|---|---|
| Add/edit dependencies | ✅ Poetry |
| Lock file generation | ✅ Poetry |
| Fast installation | ✅ uv |
| Install by group | ✅ uv via --groups=... |
-
set the
pyproject.tomlwithdynamic = ["dependencies"]like this repo -
add dependencies to your main project with peotry and it will generate
poetry.lockfileeg.
poetry add numpy -
add dependencies to specific groups and add line to
poetry.lockfile for the groupseg.
poetry add pytest --group devpoetry add ruff --group unittest -
handle the installation for your main project with uv
eg.
uv pip install -r <(uv pip compile poetry.lock) -
handle the installation for specific groups
eg.
uv pip install -r <(uv pip compile --groups=dev poetry.lock)uv pip install -r <(uv pip compile --groups=unittest poetry.lock)