← All notes

Group Python packages in a uv workspace that shares one lockfile

Answer: Inspired by Cargo, uv treats a workspace as packages (the workspace members) managed together as one collection. Each package defines its own project metadata, but the workspace shares a single lockfile, so it operates with a consistent set of dependencies.

Layout

Every workspace needs a root, which is a workspace member. To create a workspace, add a workspace table and specify members, including include or exclude directories. Creating a package inside an existing package will add the newly created member to the workspace, and can create the table in the workspace root if it doesn't already exist. A command operates on the entire workspace at once by default, or on the workspace root, though you can run a command in a particular workspace member from any workspace directory.

Metadata

PEP 621 specifies how to write a project's core metadata in pyproject.toml. Workspace members keep that per-package table. The shared lockfile is how the workspace keeps a consistent set of dependencies.

Gotcha

In defining a workspace, you must specify the members.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: uv docs, Using workspaces; Python PEPs, PEP 621 – Storing project metadata in pyproject.toml. MIT; Public-Domain. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: uv docs, Using workspaces; Python PEPs, PEP 621 – Storing project metadata in pyproject.toml. MIT; Public-Domain.

Cite this

Permanent ID: iil:note:d91kcca7

iinventedlight. 2026. "Group Python packages in a uv workspace that shares one lockfile." iinventedlight Library, iil:note:d91kcca7, version of 2026-11-19. https://iinventedlight.com/library/notes/uv-workspaces/. License: CC-BY-4.0.

@misc{iil_note_d91kcca7,
  author = {{iinventedlight}},
  title = {{Group Python packages in a uv workspace that shares one lockfile}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-19},
  url = {https://iinventedlight.com/library/notes/uv-workspaces/},
  note = {Permanent ID iil:note:d91kcca7. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/uv-workspaces.md.