Skip to main content

Easily toggle between development and production packages with uv. Quickly close development packages locally.

Project description

Python Uv Development Package Toggler

A utility script for easily switching between local development and published sources for Python packages in your pyproject.toml.

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

Installation

pip 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 --published

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

Arguments

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

Environment Variables

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

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_development_toggle-0.3.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

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

uv_development_toggle-0.3.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file uv_development_toggle-0.3.0.tar.gz.

File metadata

File hashes

Hashes for uv_development_toggle-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d69689ffc0120625816f76cda53c634ad52df2f3cecd00d95dcc745caea6e547
MD5 fe461c2950645f044b511e780d411ea3
BLAKE2b-256 7995ed820ff0fa04cc609cb1c914575b158208aeaed5b24102990bf3978efcd6

See more details on using hashes here.

File details

Details for the file uv_development_toggle-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for uv_development_toggle-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 664729b18f78b9c31bbf5bb00399976eba5e0e4b390f7345a88b304c42f0a588
MD5 19c8b4a3a20a34d27c5430c48d808b67
BLAKE2b-256 9a74c9be3a3dd632a1eb812cd8d3f2a4a52db96d6a0ae71eb88a3179e4f4cf6f

See more details on using hashes here.

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