Skip to main content

release-pypi

PyPI version Python License Tests Coverage Code style: black

A PyPI package publishing tool based on Typer framework, simplifying the process of publishing Python packages to PyPI.

Installation

pip install release-pypi

Quick Start

# Publish to PyPI
release-pypi

# Dry run (build and check only)
release-pypi --dry-run

# Skip confirmation
release-pypi --yes

# Specify build and twine versions
release-pypi --build-version "~=1.0" --twine-version "~=4.0"

Features

  • Reliable: Ensures stable and reproducible release process
  • Secure: Protects sensitive credentials from leakage
  • Robust: Comprehensive error handling and edge case handling
  • Easy to Use: Clear command-line interface and friendly user prompts

Usage

Basic Usage

# Full release
release-pypi

# Dry run
release-pypi --dry-run

# Skip confirmation
release-pypi --yes

Credential Configuration

# Method 1: Environment variables (recommended)
export TWINE_USERNAME="__token__"
export TWINE_PASSWORD="pypi-xxx"
release-pypi

# Method 2: .pypirc configuration file
cat > ~/.pypirc << 'EOF'
[pypi]
  username = __token__
  password = pypi-xxx
EOF
release-pypi

Command Line Options

Option Short Type Default Description
--dry-run - bool False Build and check only, do not upload to PyPI
--yes -y bool False Skip upload confirmation prompt
--build-version - str "~=1.0" Build package version constraint (compatible version)
--twine-version - str "~=4.0" Twine package version constraint (compatible version)

Environment Variables

Variable Description Example
TWINE_USERNAME PyPI username __token__
TWINE_PASSWORD PyPI password/Token pypi-xxx
TWINE_API_KEY PyPI API Key pypi-xxx

Development

Setup

# Clone the repository
git clone https://github.com/codearts/release-pypi.git
cd release-pypi

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # Linux/Mac
# .venv\Scripts\activate  # Windows

# Install development dependencies
pip install -e ".[dev]"

Running Tests

pytest

Code Formatting

black src tests examples

Linting

ruff check src tests examples

Type Checking

mypy src

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Changelog

See CHANGELOG.md for a list of changes in each version.

Acknowledgments

Contact

CodeArts - email@example.com

Project Link: https://github.com/codearts/release-pypi

Download files

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

Source Distribution

release_pypi_cli-0.1.0.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

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

release_pypi_cli-0.1.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file release_pypi_cli-0.1.0.tar.gz.

File metadata

  • Download URL: release_pypi_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for release_pypi_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 05aaca1265fe8cf85e8b38eb1054515950ee1da1bd20f58d27c794970dfc1af9
MD5 dc9587bccff882d70bbc9994feaf142c
BLAKE2b-256 660c28b734bd072b21d04dcf026e684d03772954ba192904242495668b440dcc

See more details on using hashes here.

File details

Details for the file release_pypi_cli-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for release_pypi_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aea6317917d8ce3616a1b066b4b81418475945d1c3ecce0be9170fafb9768530
MD5 1a3bd60d0a22ea96dacfa21d3cab6669
BLAKE2b-256 d38f5c21fceadee6099aa1b249286fc73b8a8b10a0d43229021f5456f0555d68

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

This release

0.1.0 This release

2 files

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