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:
- Initialize git repository (if not already initialized)
- 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:
- Validate the environment (pyproject.toml, build tools)
- Create a git tag and push to origin
- Clean up old build artifacts
- Build the package using
python -m build - Upload to PyPI using
uv publish(if available) ortwine 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)uvortwinefor uploading (pip install twine)ghCLI 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.1.tar.gz
(4.4 kB
view details)
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 pypublish_cli-0.2.1.tar.gz.
File metadata
- Download URL: pypublish_cli-0.2.1.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
725ead61a6c791db1be1105a251292b58a3be0a21ddd1d5b6787426a905244d8
|
|
| MD5 |
4e8e93561fed01cc2922eb5e013fb407
|
|
| BLAKE2b-256 |
3e684ee1791685b2e3172fb617a01407129460a98335d9864f370206cfd04be1
|
File details
Details for the file pypublish_cli-0.2.1-py3-none-any.whl.
File metadata
- Download URL: pypublish_cli-0.2.1-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
051781e57e9da4c703264f8309d76ad80eaf7e21817b139ed8b73660c8cf9cd3
|
|
| MD5 |
06f580b433aaac3d3d2780d3df301aba
|
|
| BLAKE2b-256 |
fe109f58e72ed4c73c223249f2df6de9adedfdd36c312a81698d0be2b2765aae
|