Skip to main content

tempest-cli

PyPI Python License: MIT

Documentação: Português (BR) · English (US)

One command for the quality gate of any Python project — ruff + mypy + pytest, with a typing-strictness dial that lives in your pyproject.toml instead of in four different Makefile targets.

Framework-agnostic on purpose: Django, Flask, Litestar, FastAPI, a library, a script. The only runtime dependency is typer.

uv add --dev tempest-cli

tempest-cli check          # lint + fmt-check + type + test, in order, stops at the first failure
tempest-cli fix            # every ruff autofix, then format
tempest-cli type -s strict # override the configured strictness for one run

tc check                   # `tc` is the short alias for the same program

Why it exists

The four commands are always the same, and every project rewrites them slightly differently — a Makefile here, a tox.ini there, a CI job that drifts from what runs locally. tempest-cli check is the same gate on your machine and in CI, and --strictness makes "how much typing do we enforce" a value in pyproject.toml rather than a flag someone remembered to pass.

Commands

Command Runs
tempest-cli lint ruff check
tempest-cli fix ruff check --fix then ruff format (--unsafe for the risky autofixes)
tempest-cli format ruff format (writes)
tempest-cli fmt-check ruff format --check (read-only)
tempest-cli type mypy
tempest-cli test pytest
tempest-cli check all four, in order, stopping at the first failure
tempest-cli pr-prompt builds the prompt that makes an AI write this branch's PR description

Every command takes an optional path (tempest-cli lint src/) and returns the underlying tool's exit code, so CI reads it exactly as it would read ruff directly.

Typing strictness

[tool.tempest]
typing_strictness = "strict"   # lenient | standard | strict

The level adds flags on top of your own [tool.ruff] / [tool.mypy] — it never relaxes what you already configured:

Level ruff (extra ANN rules) mypy
lenient none none
standard ANN001, ANN201, ANN202, ANN205, ANN206 --disallow-untyped-defs --disallow-incomplete-defs
strict the above plus ANN204 --strict

ANN401 is never enabled at any level: Any is a legitimate annotation. The levels enforce that things are annotated, never that they avoid Any.

Override per run with --strictness / -s. Absent config means standard.

PR descriptions from the branch itself

tempest-cli pr-prompt | claude -p
tempest-cli pr-prompt develop --lang en --out pr_prompt.txt

The prompt carries the repository's own pull-request template (or a bundled PT-BR / EN-US default), the rules that stop a model from handing back the template with its placeholders intact, and the branch context: commit subjects, changed files, and a bounded excerpt of each patch.

Diffs are read as base...head — the merge-base diff the forge shows — so commits that landed on the base after the branch started are not attributed to it. Whatever the bounds leave out is stated inside the prompt, so a partial diff reads as partial.

Use it as a library

from tempest_cli import load_tempest_config, run_full_check

config = load_tempest_config()
exit_code = run_full_check(".", config=config)

And to expose the same gate from your own CLI, without copying command bodies:

import typer

from tempest_cli.main import register_commands

cli: typer.Typer = typer.Typer(name="mytool")
register_commands(cli)

Installing the tools

tempest-cli shells out to whatever ruff, mypy and pytest it finds — it does not pin them, so your project chooses the versions. The lookup runs in this order:

  1. the environments of the run — the interpreter's own directory, then $VIRTUAL_ENV, then the nearest .venv up the tree;
  2. PATH, skipping a pyenv/asdf shim that dispatches nowhere (the one that answers pyenv: ruff: command not found);
  3. uv run --with <tool> <tool>, when uv is available.

To install the three alongside it:

uv add --dev "tempest-cli[tools]"

Relationship with tempest-fastapi-sdk

This package was extracted from tempest-fastapi-sdk, where the same gate shipped as tempest check. Getting it meant installing FastAPI, SQLAlchemy, Alembic and Pydantic — 38.7 MB of dependencies and roughly 0.5 s of import time per invocation, for four commands that never touch any of it.

tempest check keeps working: the SDK depends on this package and registers the same commands. Both stay in sync because there is now one implementation.

License

MIT — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tempest_cli-0.2.0.tar.gz (127.4 kB view details)

Uploaded Source

Built Distribution

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

tempest_cli-0.2.0-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tempest_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 127.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tempest_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 efe6e6acc01bd98d7ec1cce758cdfb87776240e1d3e90b4e66a6a1539d8542f2
MD5 f39f8c1657fdc90f2a16e8afa3040cb1
BLAKE2b-256 87aefd269622ef66d25aadada4d4f8975e3f9377f8ee4e0543d5a5f5d6ebee77

See more details on using hashes here.

Provenance

The following attestation bundles were made for tempest_cli-0.2.0.tar.gz:

Publisher: release-pypi.yml on mauriciobenjamin700/tempest-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: tempest_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 26.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tempest_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 defbab18d7215d897937a65b6573b8172ba3c7b7e7b5a51bf406050b8c70eedb
MD5 33078adf7f2a530558d47cd9ec6d1861
BLAKE2b-256 30744f71f160297201cb8ba56145ffc5e7c2c85cfd1a58cef57ef69fc1e00a79

See more details on using hashes here.

Provenance

The following attestation bundles were made for tempest_cli-0.2.0-py3-none-any.whl:

Publisher: release-pypi.yml on mauriciobenjamin700/tempest-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page