puba
Safe Python package release CLI.
Check, build and publish Python packages to PyPI from one command.
Install
From the project folder:
python3 -m venv .venv
.venv/bin/pip install -e .
This also installs keyring, build and twine.
Optional tools, used if installed:
Usage
1. Store your PyPI token (one time)
puba auth
The token is saved in your system keyring (macOS Keychain, Windows Credential Manager, or a Linux keyring backend).
2. Run the safety checks
puba checks
This:
- Makes sure
buildandtwineare installed (offers to install them if not) - Fails if the git working directory has uncommitted changes
- Scans for secrets with
gitleaks(skipped if not installed) - Runs
pytest(skipped if not installed or no tests are found) - Builds the package into
dist/
Nothing is uploaded.
3. Publish
puba publish # run the checks, build and upload to PyPI
puba publish --test # upload to TestPyPI instead
puba publish --dry # run the checks and build, but don't upload
Help
puba help
Token lookup
When publishing, the token is taken from, in order:
- The
PYPI_TOKENenvironment variable - The system keyring (saved with
puba auth) - A prompt
The same token is used for PyPI and TestPyPI.
CI
export PYPI_TOKEN=pypi-xxxxxxxxxxxx
puba publish
License
MIT
Metadata
Release files for puba 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| puba-1.0.0.tar.gz | 4.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| puba-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.2 kB
Release files / puba-1.0.0.tar.gz
| Download URL | puba-1.0.0.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
222a62ce30a99525f56fcccbbeca03f82cb57ceaf4841bcf248fc5686443d473
|
|
BLAKE2b-256 checksum How to use checksums |
637bc03973a0c46be6526e8b1f4e0017e0a547acafc79a463d19af3756f311d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.0
|
Release files / puba-1.0.0-py3-none-any.whl
| Download URL | puba-1.0.0-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e5b0b4bd07e3bd88d1357b8b6913f22e4532836f02b1262842184fcd4eb7fa57
|
|
BLAKE2b-256 checksum How to use checksums |
7ce99e875787c99ce7dfaf4a0080a645dd4111658eba41493cc0e8c414ca37e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.0
|