Skip to main content

Release Notes Downloads GitHub CI Status License: MIT

Python Uv Development Package Toggler

A utility script for easily switching between local development and published sources for Python packages in your pyproject.toml. Here's the original issue which spawned this project.

Here's a quick video demonstration of how to use the tool:

How to Toggle Between PyPi and Git Package Versions

Features

  • Automatically toggles between local development paths and GitHub sources
  • Preserves TOML file comments and structure
  • Automatically clones repositories when switching to local development
  • Supports branch tracking
  • Falls back to PyPI metadata if direct GitHub repository is not found
  • Integrates with GitHub CLI for username detection
  • Creates necessary TOML structure (tool.uv.sources) if it doesn't exist
  • Automatically runs uv sync --upgrade-package after successful updates

Installation

uv add --dev uv-development-toggle

uv tool install uv-development-toggle

Usage

To toggle a package activemodel:

uv-development-toggle activemodel --local

Then, after you push to a custom branch, reference the branch in your pyproject.toml:

uv-development-toggle activemodel --git

To revert a package to PyPI:

uv-development-toggle activemodel --pypi

This will:

  1. Check if the package exists in your PYTHON_DEVELOPMENT_TOGGLE directory
  2. If switching to local and the repository doesn't exist, clone it automatically (attempts to determine the repo URL from pypi information)
  3. Update your pyproject.toml with the appropriate source configuration (creating the tool.uv.sources structure if needed)
  4. Preserve any existing branch information when toggling
  5. Automatically run uv sync --upgrade-package <package_name> to apply the changes

Arguments

  • MODULE_NAME: The name of the Python module to toggle
  • --local: Force using local development path
  • --git: Force using git source
  • --pypi: Revert to default PyPI source

Environment Variables

  • PYTHON_DEVELOPMENT_TOGGLE: Directory for local development repositories (default: "pypi")

This project was created from iloveitaly/python-package-template

Metadata

Release files for uv-development-toggle 0.7.0

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-development-toggle 0.7.0
File Size Uploaded Provenance
uv_development_toggle-0.7.0.tar.gz 6.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for uv-development-toggle 0.7.0
File Interpreter ABI Platform
uv_development_toggle-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.6 kB

Release files / uv_development_toggle-0.7.0.tar.gz

Download URL uv_development_toggle-0.7.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3014bf0c11161ea3640bfc0a3482014b634a3bfea77e2fc16452f0f911e7cc87
BLAKE2b-256 checksum
How to use checksums
611c328fba26c3d652e05d15aff474730014562c7a3028baa0df724b7b1299f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / uv_development_toggle-0.7.0-py3-none-any.whl

Download URL uv_development_toggle-0.7.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec0f29f65591ecd9e157b25c3e75922489d907b3a1ca123496d0a078009f4dac
BLAKE2b-256 checksum
How to use checksums
b5378c073f6b50ed1a8478939cb496b078bee4d1dda835b47c12d8b61ff65b8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for uv-development-toggle 0.7.0

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.

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