Skip to main content

A dynamic version source plugin for uv workspaces.

Project description

uv-workspace-dynamic-versioning

A powerful Hatch plugin for dynamic versioning and dependency injection in uv workspaces.


📖 Context & Origin

This project was created to address a specific limitation in the existing uv-dynamic-versioning plugin when used within complex monorepos and uv workspaces.

As discussed in ninoseki/uv-dynamic-versioning#81, the standard implementation often calculates version distance and commit hashes based on the entire repository history. In a workspace with multiple packages, this leads to:

  1. False Positives: Packages bumping versions when unrelated code in the workspace changes.
  2. Inaccurate Metadata: Commit hashes reflecting global repo state rather than the state of the specific package.

uv-workspace-dynamic-versioning introduces Directory-Specific Patching. It re-calculates the Git distance and commit hash by filtering the history to the specific package subdirectory, ensuring that versions only reflect changes relevant to that package.


🚀 Key Features

  • VCS-Powered Versioning: Automatically derive versions from Git, Mercurial, and more via Dunamai.
  • Workspace Aware: Accurate distance and commit hash calculation restricted to the project subdirectory.
  • Dynamic Dependencies: Inject versions into dependencies using Jinja2 templates (e.g., pkg == {{ version.base }}).
  • Secure by Design: Sandboxed Jinja2 environment and Path Traversal protection.
  • Highly Configurable: Custom formats, bumping logic, and fallback versions.

🛠 Quick Start

1. Installation

Add the plugin to your build-system.requires in pyproject.toml:

[build-system]
requires = ["hatchling", "uv-workspace-dynamic-versioning"]
build-backend = "hatchling.build"

2. Basic Configuration

Enable the version source and mark the version as dynamic:

[project]
name = "my-awesome-package"
dynamic = ["version"]

[tool.hatch.version]
source = "uv-workspace-dynamic-versioning"

📚 Documentation

For full guides and API reference, visit our Documentation Site.


⚖️ License

Distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uv_workspace_dynamic_versioning-0.1.2.tar.gz (112.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uv_workspace_dynamic_versioning-0.1.2-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file uv_workspace_dynamic_versioning-0.1.2.tar.gz.

File metadata

File hashes

Hashes for uv_workspace_dynamic_versioning-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2b6bb6ed2810d8a5c994232a156e849206fdb72b29b6fb3f9de8cbc257bd955d
MD5 882b38681e36b1413e00fa69a65b4e8a
BLAKE2b-256 550cdd49db6e63b3acefff022c8f2cfe34c5e6a5f9762dfcaa31674fbaa04992

See more details on using hashes here.

Provenance

The following attestation bundles were made for uv_workspace_dynamic_versioning-0.1.2.tar.gz:

Publisher: publish.yml on indiVar0508/uv-workspace-dynamic-versioning

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uv_workspace_dynamic_versioning-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for uv_workspace_dynamic_versioning-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1efd22bd9686814b92b4b3e80ae2752fae046d5b1653393cc28862d6d3dc23e1
MD5 f7bfd3fb7ba4b43477c964ebc48dafe3
BLAKE2b-256 0c120f047576cb96379046cbdff77b55bf1194b8c10fe3c9255c6016b499eb7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for uv_workspace_dynamic_versioning-0.1.2-py3-none-any.whl:

Publisher: publish.yml on indiVar0508/uv-workspace-dynamic-versioning

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page