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
- ✓ Checks git working directory is clean
- ✓ Checks git remote 'origin' is configured
- ✓ Bumps version in
pyproject.tomlandpackage/__init__.py - ✓ Commits changes with message "Bump version to X.Y.Z"
- ✓ Creates git tag
X.Y.Z - ✓ Pushes commits and tags to GitHub
- ✓ Cleans old build artifacts
- ✓ Builds package with
python -m build - ✓ 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:
-
Git repository initialized
git init git add . git commit -m "Initial commit"
-
Git remote configured
git remote add origin https://github.com/username/package.git
-
PyPI credentials configured
- Set up
~/.pypircor use environment variables - Or configure via
twinedirectly
- Set up
Requirements
Your package must have:
pyproject.tomlwith aversionfieldpackage/__init__.pywith__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
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 publisherator-0.1.1.tar.gz.
File metadata
- Download URL: publisherator-0.1.1.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b84875d535dbe08c74abb95a9a33397841e172d5b724cbc1e770beb763b1733a
|
|
| MD5 |
6492bad62dea29cfc7f42928df0061bc
|
|
| BLAKE2b-256 |
47ce86b4943644203889cc7fa82a4c15151e492471a03eb431c918769182d0a7
|
File details
Details for the file publisherator-0.1.1-py3-none-any.whl.
File metadata
- Download URL: publisherator-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b709fd563ea7624d1f8d31c687658385115aa8d39dbae11e8edaf3ae9ad814e
|
|
| MD5 |
56e8a856a25d0969b290f7ec94dc4fc9
|
|
| BLAKE2b-256 |
7c6b49b66ba42da6d7c68b3782aa51ef2d8736ea891cd72f6ec2a6f21e24c40f
|