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 - Automatically runs
uv sync --upgrade-packageafter successful updates
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:
- Check if the package exists in your
PYTHON_DEVELOPMENT_TOGGLEdirectory - If switching to local and the repository doesn't exist, clone it automatically (attempts to determine the repo URL from pypi information)
- Update your
pyproject.tomlwith the appropriate source configuration (creating thetool.uv.sourcesstructure if needed) - Preserve any existing branch information when toggling
- 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--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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uv_development_toggle-0.5.0.tar.gz.
File metadata
- Download URL: uv_development_toggle-0.5.0.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88cb7865b84438bfdc1bce2d926432375571f431add8ac08b7a471ec97a3b0c7
|
|
| MD5 |
7b2b9dcb8cb67ab1dd02d6a8e232151c
|
|
| BLAKE2b-256 |
cbdd80f7c54391f3ff63d1da36c01fe5896552b7f8be0b30d284ef578efa7731
|
File details
Details for the file uv_development_toggle-0.5.0-py3-none-any.whl.
File metadata
- Download URL: uv_development_toggle-0.5.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb5bbcd71bb4ab409521025607ff920fb0de672921acb259a24cc614dadd3e00
|
|
| MD5 |
483838e8cde4a32aab65d9efd2b538f0
|
|
| BLAKE2b-256 |
99280d9dd9c9954dd22089f6ffa6b3d976c48d34e1e144177807b99f13cac308
|