Migrating pyproject.toml from Poetry to uv
TL;DR Link to heading
pipx install uv
uvx pdm import pyproject.toml
uvx tomlq 'del(.tool.poetry)' -i -t pyproject.toml
uvx tomlq 'del(."build-system")' -i -t pyproject.toml
uvx tomlq 'del(.tool.pdm)' -i -t pyproject.toml
Migration Link to heading
I managed to migrate my project from Poetry to uv using PDM import command.
- You will need uv installed
- Run PDM import
uvx pdm import pyproject.toml
- Remove all
[tool.poetry.*]
sections from yourpyproject.toml
uvx tomlq 'del(.tool.poetry)' -i -t pyproject.toml
- Remove
build-system
section from yourpyproject.toml
uvx tomlq 'del(."build-system")' -i -t pyproject.toml
- Remove
tool.pdm
sections from yourpyproject.toml
uvx tomlq 'del(.tool.pdm)' -i -t pyproject.toml
Another tools Link to heading
poetry-to-uv Link to heading
The code looks fine. I tried, but it failed with this error:
$ uvx poetry_to_uv pyproject.toml
...
File "~/.cache/uv/archive-v0/6p7woB22YMNNr2cWH9v7v/lib/python3.13/site-packages/poetry_to_uv/poetry.py", line 57, in _process_poetry_export_command
dependency, version = dependency_version.split("@")
^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 2)
I guess it was because my pyproject.toml
had some dependencies installed
using git, but I didn’t investigated further.
uv-migrator Link to heading
I didn’t try this one.
migrate-to-uv Link to heading
I didn’t try this one.