Skip to main content

A CLI tool for publishing Python packages to PyPI

Project description

pypublish-cli

A CLI tool for publishing Python packages to PyPI.

Installation

pip install pypublish-cli

Usage

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

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

pypublish_cli-0.2.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

pypublish_cli-0.2.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file pypublish_cli-0.2.0.tar.gz.

File metadata

  • Download URL: pypublish_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.0

File hashes

Hashes for pypublish_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a89a46dd3e9c1e833ee347e08fada224acf070f6db845aff1187fed522593e01
MD5 41e05a51fdad4fd8a9e89c04dd1cf2bd
BLAKE2b-256 1cd0c770d7013a50d3868e5bb387b7bb97db31d7fa1b87662d1b93629605a154

See more details on using hashes here.

File details

Details for the file pypublish_cli-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pypublish_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95d943239f7ec6b953b7f56adaa58ee2a2bc0afd4babfdd38c267f8d32ffe403
MD5 3a08e5fd94af14bd8140534c7402814a
BLAKE2b-256 7e3ee32a88cd550386a468533bacd8c75add5afda0ccc6eddf602f1543742ff0

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