Skip to main content

One-command Python package publishing: bump version, commit, tag, push to GitHub, build, and upload to PyPI

Project description

Publisherator

One-command Python package publishing: bump version, commit, tag, push to GitHub, build, and upload to PyPI.

Problem

Publishing Python packages requires multiple manual steps: updating version numbers in multiple files, committing changes, creating git tags, pushing to GitHub, building the package, and uploading to PyPI. This repetitive process is error-prone and time-consuming.

Solution

A lightweight CLI tool that automates the entire publishing workflow with a single command.

Installation

pip install publisherator

Usage

# Bump patch version (1.0.0 → 1.0.1)
publisherator patch

# Bump minor version (1.0.1 → 1.1.0)
publisherator minor

# Bump major version (1.1.0 → 2.0.0)
publisherator major

# Default is patch if no argument provided
publisherator

What It Does

  1. ✓ Checks git working directory is clean
  2. ✓ Checks git remote 'origin' is configured
  3. ✓ Bumps version in pyproject.toml and package/__init__.py
  4. ✓ Commits changes with message "Bump version to X.Y.Z"
  5. ✓ Creates git tag X.Y.Z
  6. ✓ Pushes commits and tags to GitHub
  7. ✓ Cleans old build artifacts
  8. ✓ Builds package with python -m build
  9. ✓ Uploads to PyPI with twine upload

Options

# Preview changes without executing
publisherator patch --dry-run

# Custom commit message
publisherator minor --message "Release new features"
publisherator minor -m "Release new features"

# Skip git operations (only publish to PyPI)
publisherator patch --skip-git

# Skip PyPI upload (only push to git)
publisherator patch --skip-pypi

First-Time Setup

Before using publisherator, ensure:

  1. Git repository initialized

    git init
    git add .
    git commit -m "Initial commit"
    
  2. Git remote configured

    git remote add origin https://github.com/username/package.git
    
  3. PyPI credentials configured

    • Set up ~/.pypirc or use environment variables
    • Or configure via twine directly

Requirements

Your package must have:

  • pyproject.toml with a version field
  • package/__init__.py with __version__ variable (optional but recommended)

Error Handling

Git push fails: Automatically rolls back commit and tag

PyPI upload fails: Provides recovery instructions:

  • Retry: twine upload dist/*
  • Rollback: git reset --hard HEAD~1 && git tag -d X.Y.Z && git push origin --delete X.Y.Z

Features

  • ✓ Semantic versioning (major.minor.patch)
  • ✓ Multi-file version sync
  • ✓ Git automation with rollback on failure
  • ✓ Works with any git remote (GitHub, GitLab, Bitbucket, etc.)
  • ✓ Zero configuration needed
  • ✓ Helpful error messages

License

MIT

Author

Arved Klöhn

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

publisherator-0.1.5.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

publisherator-0.1.5-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file publisherator-0.1.5.tar.gz.

File metadata

  • Download URL: publisherator-0.1.5.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for publisherator-0.1.5.tar.gz
Algorithm Hash digest
SHA256 70bbd8cb161c7877a00deb236d34fafe5408eb4e84b525e1badf85ce6143a16e
MD5 f80a25f2a11bd832cc429f794a398a4d
BLAKE2b-256 bb6176a1451960d9687498bf266c6e6c05083c9160600656a8e8e24649aedd29

See more details on using hashes here.

File details

Details for the file publisherator-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: publisherator-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for publisherator-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 055b4bc9858eb16cd4d5d74ea2748d8dccf5701ed21b1aed24d7dac64f4e92d6
MD5 5d533b36c9fa0978046b72cff94b550c
BLAKE2b-256 0b6006697469179dfb5b188d13d6bacc21f1fd7191415020d1fcb1f9ddeff9d7

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