Skip to main content

PyPI Release Tool banner

kingkybel-pypi-release-tool

Automated release workflow for Python packages, including version bumping, test execution, build, upload, and git tagging.

Features

  • 🚀 Automated Release Flow: Handles release lifecycle from version checks to final upload
  • 🧪 Integrated Testing: Runs project tests before packaging
  • 📦 Build + Upload: Builds distributions and uploads with Twine
  • 🔢 Version Management: Supports patch, minor, and major bumps
  • 🧰 Interpreter Detection: Finds available Python interpreters and selects highest version
  • 🏷️ Git Integration: Commits, pushes, and tags release versions
  • 🛟 Dry-Run Support: Preview release actions without changing repository state

Installation

pip install kingkybel-pypi-release-tool

Or from source:

git clone https://github.com/kingkybel/PyPIReleaseTool.git
cd PyPIReleaseTool
pip install -e .

Quick Start

# Default patch release
python release_to_pypi.py

# Minor or major release
python release_to_pypi.py --minor
python release_to_pypi.py --major

# Dry-run only
python release_to_pypi.py --dry-run

CLI Usage

python release_to_pypi.py [--repo REPO_DIR] [--minor] [--major] [--dry-run]

Options:

  • --repo, -r: Target repository directory (defaults to current directory)
  • --minor, -m: Increment minor version (x.y.z -> x.y+1.0)
  • --major, -M: Increment major version (x.y.z -> x+1.0.0)
  • --dry-run: Show actions without changing files, git state, or PyPI

Release Script

For packaging-only flows aligned with modern publishing practice:

./release.sh --help
./release.sh --testpypi-only
./release.sh --skip-testpypi
./release.sh --skip-upload

Package Layout

PyPIReleaseTool/
├── assets/
│   └── banners/
│       └── pypi-release-tool-banner.svg
├── pypi_release_tool/
│   ├── __init__.py
│   ├── __main__.py
│   └── release_tool.py
├── release_to_pypi.py
├── pyproject.toml
├── setup.py
├── release.sh
├── requirements.txt
└── README.md

Requirements

  • Python 3.8+
  • Git configured with push access
  • Twine credentials in ~/.secrets using TWINE_USERNAME/TWINE_PASSWORD, or interactive token entry at upload time

PyPI Credentials

The Python release workflow (release_to_pypi.py) looks for Twine credentials in ~/.secrets first.

Example:

export TWINE_USERNAME="__token__"
export TWINE_PASSWORD="pypi-AgENdGVzdC5weXBpLm9yZwIk..."

Behavior:

  • If both TWINE_USERNAME and TWINE_PASSWORD are found in ~/.secrets, they are used automatically.
  • If one or both are missing, a warning is shown and you are prompted for the PyPI token/password securely.

Notes

  • The tool expects a valid pyproject.toml and package __init__.py with a __version__ field.
  • The default workflow assumes main as the primary git branch.

Metadata

Release files for kingkybel-pypi-release-tool 0.1.2

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

Source distribution (sdist)

Source distribution for kingkybel-pypi-release-tool 0.1.2
File Size Uploaded Provenance Actions
kingkybel_pypi_release_tool-0.1.2.tar.gz 13.2 kB Without provenance Details for kingkybel_pypi_release_tool-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kingkybel-pypi-release-tool 0.1.2
File Interpreter ABI Platform Actions
kingkybel_pypi_release_tool-0.1.2-py3-none-any.whl Python 3 none any Details for kingkybel_pypi_release_tool-0.1.2-py3-none-any.whl

Total release size: 24.9 kB

Release files / kingkybel_pypi_release_tool-0.1.2.tar.gz

Download URL kingkybel_pypi_release_tool-0.1.2.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2d2c8b0f7a8310096c6883fd03200806b95601a65bdf7ef02031529ba7d3da6a
BLAKE2b-256 checksum
How to use checksums
95d4076994b4094417b3bbd976163d2064fdb1c7632a3839235aedd04fa52edb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / kingkybel_pypi_release_tool-0.1.2-py3-none-any.whl

Download URL kingkybel_pypi_release_tool-0.1.2-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef0045cdec5ba3dad9e3bbfb38c42fa3a7497c78a8980cc48fc543a3137d7d9c
BLAKE2b-256 checksum
How to use checksums
4a06a112f9c3550e03a1f4a51cff4a64466a0c98955924309da333d02924edbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for kingkybel-pypi-release-tool 0.1.2

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

0.1.2 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