Skip to main content

uv-monorepo-dependency-tool

PyPI PyPI - Python Version PyPI - Wheel PyPI - Downloads License Build uv-monorepo-dependency-tool

Overview

The uv-monorepo-dependency-tool is designed to simplify dependency management in monorepos that utilize path dependencies. It streamlines the process of building archives by rewriting path dependencies to reference the appropriate pinned version dependencies from the referenced project's pyproject.toml.

This helps package consumers avoid replicating complex folder structures within their own projects. Instead, they can directly rely on the pinned version dependencies specified during the archive-building process.

Features

  • Automated Rewrite of Path Dependencies: Converts editable path dependencies into pinned version dependencies during archive generation.
  • Improved Package Metadata: Adjusts dependency metadata in generated archives to use pinned versions, ensuring better compatibility for consumers of the package.
  • Monorepo Support: Designed specifically for managing dependencies across complex UV-based monorepos.
  • CLI Support: Run commands directly from the terminal for seamless integration with your development workflow.

Getting Started

Installation

To use this tool in your environment, from the root project directory run

#TODO: update to published package
uv tool install uv-monorepo-dependency-tool/dist/uv_monorepo_dependency_tool-1.0.0.dev0-py3-none-any.whl 

Usage

The uv-monorepo-dependency-tool works during the archive-building process. It analyzes pyproject.toml files of dependencies in the monorepo and replaces editable path dependencies with the corresponding pinned version dependencies.

For example, assume that project-a and project-a-consumer are uv projects that exist within the same monorepo and use the following pyproject.toml configurations.

project-a/pyproject.toml:

[project]
name = "project-a"
version = "1.0.0.dev0"

project-a-consumer/pyproject.toml:

[project]
name = "project-a-consumer"
version = "1.0.0.dev0"
dependencies = ["project-a"]

[tool.uv.sources]
project-a = { path = "../project-a", editable = true }

When generating wheel or sdist archives for project-a-consumer via build-rewrite-path-deps, the corresponding package-a-consumer source distribution will be constructed as if its dependency on the project-a project were declared as project-a = "1.0.0.dev0". As a result, package metadata in archives for project-a-consumer will shift from Requires-Dist: project-a to Requires-Dist: project-a=="1.0.0.dev0".

Command Line Mode

To execute the tool from the command line, navigate to the desired package directory and run the following command:

uv tool run uv-monorepo-dependency-tool build-rewrite-path-deps --version-pinning-strategy=mixed     

This will generate the updated archive with the rewritten dependencies.

Configuration

The following cli options are supported :

* `--version-pinning-strategy` (`string`, default: `mixed`, options: `mixed`, `exact`): Strategy by which path
  dependencies to other Poetry projects will be versioned in generated archives. Given a path dependency to a Poetry project
  with version `1.2.3`, the version of the dependency referenced in the generated archive is `=1.2.3` for `exact`.  `mixed` mode switches versioning strategies based on whether the dependency
  UV project version is an in-flight development version or a release - if a development version (i.e. `1.2.3.dev456`),
  `mixed` can be used to specify the inclusion of subsequent dev releases (i.e. `>=1.2.3.dev`), and
  if a release version (i.e. `1.2.3`), `exact` is applied (i.e. `=1.2.3`).

Licence

uv-monorepo-dependency-tool is available under the MIT licence.

Metadata

Release files for uv-monorepo-dependency-tool 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uv-monorepo-dependency-tool 1.0.1
File Size Uploaded Provenance Actions
uv_monorepo_dependency_tool-1.0.1.tar.gz 7.8 kB Without provenance Details for uv_monorepo_dependency_tool-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for uv-monorepo-dependency-tool 1.0.1
File Interpreter ABI Platform Actions
uv_monorepo_dependency_tool-1.0.1-py3-none-any.whl Python 3 none any Details for uv_monorepo_dependency_tool-1.0.1-py3-none-any.whl

Total release size: 13.1 kB

Release files / uv_monorepo_dependency_tool-1.0.1.tar.gz

Download URL uv_monorepo_dependency_tool-1.0.1.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7ef2845f77759dc97383b1d72ded5f31163eca69a1734f099e7617f4380939fd
BLAKE2b-256 checksum
How to use checksums
a5c19c97b4058a3856a287a4bb6176fa7ad1da0854586afe4348d3458eec4b89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.10

Release files / uv_monorepo_dependency_tool-1.0.1-py3-none-any.whl

Download URL uv_monorepo_dependency_tool-1.0.1-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53892f31d20ebdac9d762ca7fe8faa810e8d4ef06ae69fddc163ed0a3716dafe
BLAKE2b-256 checksum
How to use checksums
233140f378894a7ae4a50644c20ad721f6ddaf456d2f6f109349429656551790
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.10

Security for uv-monorepo-dependency-tool 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page