Skip to main content

tablish

A typed Python 3.12+ CLI tool for releasing Python packages to PyPI, configured via [tool.tablish] in pyproject.toml.

What it does

  1. Verifies you are at the root of the expected git repository with a clean working tree.
  2. Reads and bumps your semver file (break/major, feature/minor, bugfix/patch, or an explicit MAJOR.MINOR.PATCH version).
  3. Runs your project's lint/test command (or check-manifest when --skip-lint is passed) and verifies it leaves the working tree clean.
  4. Optionally generates extra version/metadata files (and rolls them back automatically on --dry-run, --test, or failure).
  5. Builds sdist and wheel with build and validates them with twine check.
  6. Uploads to PyPI (or test.pypi.org with --test) using a token from secrets.json or TWINE_PASSWORD.
  7. Commits the updated version file(s), creates an annotated git tag, and pushes with --follow-tags.

Installation

pip install tablish

Or install locally in editable mode:

pip install -e /path/to/tablish

Requires Python 3.12+.

Usage

Run tablish from your project's root directory (or pass -C PATH):

tablish bugfix                  # bump patch version (or `patch`) and publish to pypi.org
tablish feature --dry-run       # bump minor version (or `minor`) without uploading or committing
tablish break --test            # bump major version (or `major`), upload to test.pypi.org, and roll back
tablish 2.0.0                   # release an explicit version
tablish bugfix --skip-lint      # skip lint command (still runs check-manifest if enabled)
tablish bugfix --no-tag         # skip creating/pushing a git tag
tablish bugfix --verbose-pypi   # show verbose output and error details from PyPI upload
tablish info                    # display resolved publish metadata (explicit vs defaulted)
tablish resume                  # finish remaining upload and/or git steps after a failure

tablish info

Prints the resolved metadata and preflight status that tablish would use to publish—including project paths, current version, target repository, credential and gitignore status (without printing any token), lint/build settings, required tools, and git release settings. Each entry shows whether it was set explicitly in [tool.tablish], inferred from pyproject.toml, defaulted, or overridden by CLI flags (such as --test, --skip-lint, --no-tag, --verbose-pypi, or -C), using terminal color when supported.

tablish resume

Continues an interrupted release after an irreversible PyPI upload has already started or completed, without rebuilding or re-uploading already-published files. If twine upload fails partway through uploading distribution files, tablish resume uploads only the remaining file(s) with --skip-existing (supporting --verbose-pypi) and cleans up build artifacts; if a post-upload git step (add, commit, tag, or push) fails, it skips steps already completed and finishes the rest. Supports --dry-run to preview remaining actions and --no-tag to skip tagging.

PyPI Credentials

By default, tablish reads a JSON file at secrets.json (gitignored!) in your project root:

{
  "pypi.org release key": "pypi-...",
  "test.pypi.org release key": "pypi-..."
}

If the secrets file is inside the repository (including the default secrets.json), tablish verifies that it is untracked and gitignored and refuses to run if it is not. If the secrets file is absent, tablish falls back to the TWINE_PASSWORD environment variable (and TWINE_USERNAME, defaulting to __token__). You can also point secrets-file to a shared path outside the repository such as ~/.config/tablish/secrets.json.

Configuration (pyproject.toml)

All keys under [tool.tablish] are optional; sensible defaults are inferred from pyproject.toml.

[tool.tablish]
project-name = "myproject"          # defaults to [project].name (set "" to disable remote/dir match)
semver-file = "semver.txt"          # defaults to [tool.setuptools.dynamic].version.file or "semver.txt"
secrets-file = "secrets.json"       # relative to project root, or absolute / ~-expanded path
pypi-secret-key = "pypi.org release key"
test-pypi-secret-key = "test.pypi.org release key"
pypi-url = ""                       # optional custom repository URL for production uploads
test-pypi-url = "https://test.pypi.org/legacy/"
build-dirs = ["build", "dist"]
lint-command = ["sh", "lint"]       # list of args, shell string, or false to disable (defaults to ./lint)
check-manifest = true               # run check-manifest when lint is skipped or disabled
check-manifest-args = ["--no-build-isolation"]
tag = true                          # create and push an annotated git tag (overridden by --no-tag)
tag-format = "v{version}"
tag-message = "Release {version}"
commit-message = "Bump semver to {version}"

Extra generated files

Projects that also maintain generated version/build info files can declare [[tool.tablish.generated-files]] entries. Each entry takes a relative path and either a command (whose stripped stdout is written to path) or a template string (with {version} replaced):

[[tool.tablish.generated-files]]
path = "mypkg/version-info.txt"
command = ["git", "log", "-1", "--format=mypkg version %h, updated %cd"]

[[tool.tablish.generated-files]]
path = "mypkg/_version.py"
template = '__version__ = "{version}"\n'

Generated files are written alongside semver-file before building, staged and committed on real releases, and automatically rolled back (or deleted if newly created) on --dry-run, --test, or errors.

Development

pip install -r requirements-dev.txt
./lint      # runs ruff, black, mypy, pylint (10/10), check-manifest, and pytest

See CONTRIBUTING.md for coding conventions.

License

MIT License — see LICENSE.

Metadata

Release files for tablish 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tablish 1.1.0
File Size Uploaded Provenance Actions
tablish-1.1.0.tar.gz 38.2 kB Without provenance Details for tablish-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tablish 1.1.0
File Interpreter ABI Platform Actions
tablish-1.1.0-py3-none-any.whl Python 3 none any Details for tablish-1.1.0-py3-none-any.whl

Total release size: 65.0 kB

Release files / tablish-1.1.0.tar.gz

Download URL tablish-1.1.0.tar.gz
Size 38.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5f8deed0c58054bee54d7eb634e49e83cb68c596cf29f58e6cb9792acb0dcf5f
BLAKE2b-256 checksum
How to use checksums
801c39a079739210c1d1cd03f9ec2e36cf7456eeb5cc608ded136be4b28b2b43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / tablish-1.1.0-py3-none-any.whl

Download URL tablish-1.1.0-py3-none-any.whl
Size 26.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28185b273c223c055d30daed8c70d121ea1e6bf60ec8972a1eeef585b1cefba1
BLAKE2b-256 checksum
How to use checksums
b91db11383acf98d0a8ba43caca8c04a1d5dfffaf02c0c87d310bcb1cca49578
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for tablish 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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