Skip to content

Add monorepo support to uv with uv init --monorepo and other supporting commands #11095

Open
@matthewadams

Description

@matthewadams

Summary

As mentioned in #10960, the completion of that issue could lead to new features in uv that might include monorepo scaffolding via something like uv init --monorepo and even, given an existing, uv-compliant monorepo, scaffolding where a developer could add new libraries and applications to the monorepo, like:

mkdir -p "$MONOREPO_ROOT_DIR"
cd "$MONOREPO_ROOT_DIR"
uv init --monorepo --interactive # prompts for libraries & applications to be included, addressing public/private visibility

# perhaps adds monorepo metadata to the root pyproject.toml file or a file like monorepo.uv or uv.toml describing the projects comprising the monorepo

# ...some time later...

# thanks to uv monorepo metadata, uv is monorepo-aware

uv monorepo init --lib foobar # adds a new library project to the monorepo
# maybe supports visibility options like --public, --private, or even --unpublished
# for libraries intended to be embedded in apps
uv monorepo init --app myapp --embeds-libs foobar,snafu # adds a new app that embeds libraries foobar & snafu

My suspicion is that the implementation could be monorepo lipstick over uv workspaces. Also, it just occurred to me that, while this is needed in a literal monorepo, the more general concept, for lack of a better term, might be "multimodule project", "multiproject", "solution", etc. Feel free to rename.

Example

See https://github.com/matthewadams/uv-monorepo for WIP uv monorepo.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement to existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions