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)

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.0.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.0.0
File Size Uploaded Provenance Actions
tablish-1.0.0.tar.gz 30.4 kB Without provenance Details for tablish-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 52.1 kB

Release files / tablish-1.0.0.tar.gz

Download URL tablish-1.0.0.tar.gz
Size 30.4 kB
Tags Source
SHA-256 checksum
How to use checksums
29bc19fd42565af8caa8cc0dc211fcf9f77f95c19e8a29784d4f9751bbfdec10
BLAKE2b-256 checksum
How to use checksums
3a1fc0187ee2cc1fc9360cfd2900660bee37c4c75915ea1868101f002926f021
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

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

Download URL tablish-1.0.0-py3-none-any.whl
Size 21.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f5c8976b533d283ff8c53e1c5ac746d67b0a3c230f8cbf8e37a63b28f5ede4f
BLAKE2b-256 checksum
How to use checksums
a243112315831c38bebd26cb160840a068b3a549288954a791aa5c1d88583667
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for tablish 1.0.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