Skip to main content

pypublish-cli

A CLI tool for publishing Python packages to PyPI.

Installation

pip install pypublish-cli

Usage

Initialize pyproject.toml

pypublish --init-pyproject    # Add setuptools_scm config to pyproject.toml (creates it if missing)

Initialize repository

pypublish --init-repo              # Initialize local git repo only
pypublish --init-repo --github     # Initialize git and create GitHub repo
pypublish --init-repo --github myproject  # Specify custom repo name
pypublish --init-repo --github --private  # Create private GitHub repo
pypublish --github                 # Create GitHub repo (git already initialized)

--init-repo will:

  1. Initialize git repository (if not already initialized)
  2. Add all files and create initial commit

--github additionally: 3. Create GitHub repository using gh CLI 4. Push to GitHub

Full publish workflow

pypublish 0.2.0              # Full publish: tag, build, upload
pypublish v0.2.0             # Full publish: tag, build, upload

This will:

  1. Validate the environment (pyproject.toml, build tools)
  2. Create a git tag and push to origin
  3. Clean up old build artifacts
  4. Build the package using python -m build
  5. Upload to PyPI using uv publish (if available) or twine upload

Partial workflows

pypublish 0.2.0 --tag-only         # Only create and push tag
pypublish 0.2.0 --build-only       # Tag and build, don't upload
pypublish 0.2.0 --no-build         # Tag and upload existing dist/
pypublish 0.2.0 --no-upload        # Tag and build, don't upload

Delete a tag

pypublish --delete-tag 0.2.0       # Delete tag locally and from origin
pypublish --delete-tag v0.2.0      # Delete tag locally and from origin

Requirements

  • Python >= 3.7
  • build (pip install build)
  • uv or twine for uploading (pip install twine)
  • gh CLI for GitHub repository creation

License

MIT

Metadata

Release files for pypublish-cli 0.2.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 pypublish-cli 0.2.2
File Size Uploaded
pypublish_cli-0.2.2.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pypublish-cli 0.2.2
File Interpreter ABI Platform
pypublish_cli-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.8 kB

Release files / pypublish_cli-0.2.2.tar.gz

Download URL pypublish_cli-0.2.2.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0c5bf3160ec86b10105f9eee5a84081d22704cd6dcd1a6ac8be468fbd9a24eed
BLAKE2b-256 checksum
How to use checksums
202977b4e779081bc1a6ff6df5108932f37b75e1fed9a0a848cd36cf2a7d6d7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / pypublish_cli-0.2.2-py3-none-any.whl

Download URL pypublish_cli-0.2.2-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
219cca46c0df34dcd83c14100e592c16a966c378b9ba61b42d6cbc160ce5d36a
BLAKE2b-256 checksum
How to use checksums
bef3826687cdcf2fd728215809df424b63e9335e592cb79eb9eb839d7a25c65f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release 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