tool-uv-monorepo

Configure uv workspaces for Python monorepos with a unified dependency graph.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/nishide-dev/claude-code-ml-research --skill tool-uv-monorepo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tool-uv-monorepo
Source: https://github.com/nishide-dev/claude-code-ml-research/tree/main/skills/tool-uv-monorepo
Command: npx skills add https://github.com/nishide-dev/claude-code-ml-research --skill tool-uv-monorepo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves dependency drift and inconsistent environments across multiple Python packages living in the same repository by giving you a single, unified workspace setup.

Core Features & Use Cases

  • Unified lock file for the whole monorepo: create one uv.lock that resolves all workspace members together, keeping versions consistent across packages.
  • Shared editable installs: use workspace = true so internal packages update instantly during development without reinstalling.
  • Monorepo-ready testing and build patterns: apply recommended pytest import settings, and use Docker multi-stage builds to avoid bloated images by exporting service-specific dependencies.
  • Use cases: multi-package CLI + core + services repos, internal library ecosystems, and migrations from poly-repos where versions must be aligned before consolidating.

Quick Start

Configure your root pyproject.toml as a uv workspace by setting [tool.uv.workspace] members = ["packages/*"] and adding a single uv.lock, then sync the repository with uv sync --group dev.

Frequently Asked Questions about tool-uv-monorepo

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage dependencies in a Python monorepo to prevent version drift?

To prevent version drift in a Python monorepo, you can use uv workspaces to create a single unified dependency graph. This generates one uv.lock file that resolves all workspace members together, keeping versions consistent across all packages.

How do I set up editable installs for interdependent Python packages?

To set up editable installs for interdependent Python packages, configure a root pyproject.toml with [tool.uv.workspace] and set workspace = true. This allows internal packages to update instantly during development without requiring reinstallation.

Can I use uv workspaces to optimize Docker builds for a Python monorepo?

Yes, you can use uv workspaces to optimize Docker builds for a Python monorepo by leveraging multi-stage builds. This approach exports service-specific dependencies, preventing bloated images by including only what is needed for each service.

What is the best way to consolidate multiple Python repositories into a monorepo?

The best way to consolidate multiple Python repositories into a monorepo is by using uv workspaces. It allows you to align versions across shared core libraries, APIs, and CLIs using a single lock file before migrating from a poly-repo setup.

Do I need a single lock file for all packages in a uv workspace?

Yes, a uv workspace requires a single uv.lock file generated by uv lock or uv sync. This unified lock file ensures that all interdependent packages in the Python monorepo share a consistent dependency graph.

Why does my uv workspace require a root pyproject.toml with package = false?

A uv workspace requires a root pyproject.toml with package = false to designate the workspace root as a non-package container. This configuration allows uv to properly manage multiple member packages under a single unified dependency graph.