yarn import uv — Yarn CLI reference

Import uv projects as Yarn workspaces

Docs/Reference/CLI/import/uv

yarn import uv

Import uv projects as Yarn workspaces

yarn import uv <FOLDERS…>

For each folder containing a pyproject.toml, this command writes a package.json next to it describing the same dependencies, registers the folder as a workspace of the current project, and adds a venv island for it in .yarnrc.yml. The conversion covers:

  • project.dependencies → dependencies (pypi: ranges, extras and markers preserved); - the dev dependency group (and legacy tool.uv.dev-dependencies) → devDependencies; other groups are reported and skipped unless listed with --group; - tool.uv.sources path / workspace entries → workspace:^ (the target must be imported too, which happens automatically with --recursive); index entries → a packageRules entry routing the package to the index; - tool.uv.override-dependencies → the workspace’s resolutions; - tool.uv.constraint-dependencies → the island’s pypiConstraints; - requires-python → the island’s pythonVersion (lowest allowed minor); - uv.lock → the island’s pypiSeedLockfile, so the first install keeps the versions uv had locked; - uv workspace members → workspaces sharing their root’s island (uv resolves a workspace as a whole).

Run with --dry-run to print the generated files without writing them.

#--recursive, -rboolean

Also import the projects referenced through path sources and uv workspace members

#--dry-runboolean

Print the files that would be written, without writing them

#--groupboolean

Dependency groups (besides dev) to import as devDependencies

#--extraboolean

Extras of the imported projects to install in their own venvs, as

#--all-extrasboolean

Install all the extras of the imported projects in their own venvs,