tempest-cli 0.1.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. tempest_cli-0.3.0/CHANGELOG.md +109 -0
  2. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/PKG-INFO +27 -7
  3. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/README.md +25 -5
  4. tempest_cli-0.3.0/docs/changelog.en.md +71 -0
  5. tempest_cli-0.3.0/docs/changelog.md +71 -0
  6. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/docs/commands.en.md +10 -2
  7. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/docs/commands.md +9 -2
  8. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/docs/index.en.md +4 -1
  9. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/docs/index.md +4 -1
  10. tempest_cli-0.3.0/docs/installation.en.md +107 -0
  11. tempest_cli-0.3.0/docs/installation.md +107 -0
  12. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/pyproject.toml +17 -6
  13. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/tempest_cli/__init__.py +8 -4
  14. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/tempest_cli/lint.py +147 -11
  15. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/tests/test_cli.py +20 -0
  16. tempest_cli-0.3.0/tests/test_lint_runners.py +369 -0
  17. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/uv.lock +3 -3
  18. tempest_cli-0.1.0/CHANGELOG.md +0 -53
  19. tempest_cli-0.1.0/docs/changelog.en.md +0 -31
  20. tempest_cli-0.1.0/docs/changelog.md +0 -31
  21. tempest_cli-0.1.0/docs/installation.en.md +0 -61
  22. tempest_cli-0.1.0/docs/installation.md +0 -59
  23. tempest_cli-0.1.0/tests/test_lint_runners.py +0 -154
  24. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/.github/workflows/ci.yml +0 -0
  25. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/.github/workflows/docs.yml +0 -0
  26. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/.github/workflows/release-pypi.yml +0 -0
  27. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/.gitignore +0 -0
  28. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/LICENSE +0 -0
  29. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/Makefile +0 -0
  30. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/docs/configuration.en.md +0 -0
  31. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/docs/configuration.md +0 -0
  32. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/docs/library.en.md +0 -0
  33. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/docs/library.md +0 -0
  34. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/docs/pr-prompt.en.md +0 -0
  35. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/docs/pr-prompt.md +0 -0
  36. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/docs/reference.en.md +0 -0
  37. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/docs/reference.md +0 -0
  38. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/mkdocs.yml +0 -0
  39. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/tempest_cli/_templates/pull_request_template.en-US.md +0 -0
  40. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/tempest_cli/_templates/pull_request_template.pt-BR.md +0 -0
  41. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/tempest_cli/config.py +0 -0
  42. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/tempest_cli/main.py +0 -0
  43. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/tempest_cli/pr_prompt.py +0 -0
  44. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/tempest_cli/py.typed +0 -0
  45. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/tests/__init__.py +0 -0
  46. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/tests/test_config.py +0 -0
  47. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/tests/test_lint_strictness.py +0 -0
  48. {tempest_cli-0.1.0 → tempest_cli-0.3.0}/tests/test_pr_prompt.py +0 -0
@@ -0,0 +1,109 @@
1
+ # Changelog
2
+
3
+ All notable changes to **tempest-cli** are listed below.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.3.0] — 2026-08-15
9
+
10
+ ### Changed
11
+
12
+ - **`ruff` now ships with the package.** It moved from the `[tools]`
13
+ extra into the runtime dependencies, so `uv add --dev tempest-cli` is
14
+ enough for `lint`, `fix`, `format` and `fmt-check` to run — no second
15
+ install, and no dependency on `uv` being around to fetch one. The cost
16
+ is nil: ruff is a static binary wheel with no Python dependencies of
17
+ its own, so no bound of its reaches a consumer's resolution.
18
+
19
+ `mypy` and `pytest` stay out on purpose. A mypy bump changes which
20
+ errors a codebase reports and pytest has to match the suite and its
21
+ plugins — those are the project's call. `[tools]` now installs exactly
22
+ those two.
23
+
24
+ - **The project's environment is searched before the CLI's own.** With
25
+ ruff bundled, the CLI's environment always has one; looking there
26
+ first would silently override a version the project pinned whenever
27
+ `tempest-cli` is installed apart from it (`uv tool install`, pipx).
28
+ The order is now `$VIRTUAL_ENV` → nearest `.venv` → the CLI's own
29
+ environment → `PATH` → `uv run --with`.
30
+
31
+ ## [0.2.0] — 2026-08-15
32
+
33
+ ### Added
34
+
35
+ - **`tc`, the short alias.** The package now installs a second console
36
+ script pointing at the same entry point, so `tc check` is `tempest-cli
37
+ check`. While the installing environment is on `PATH`, `tc` shadows
38
+ iproute2's `tc(8)`; call the traffic controller as `/usr/sbin/tc` when
39
+ you need it.
40
+
41
+ ### Fixed
42
+
43
+ - **The gate no longer runs a dead pyenv/asdf shim.** `tempest-cli fix`
44
+ in a project whose environment has no ruff answered `pyenv: ruff:
45
+ command not found` and exited 127 — the lookup took the first `PATH`
46
+ hit, and on a version-manager machine that hit is a shim that exists
47
+ for every tool any installed interpreter ever provided. The lookup now
48
+ searches the environments that belong to the run first (the CLI's own
49
+ interpreter directory, `$VIRTUAL_ENV`, the nearest `.venv`), accepts a
50
+ shim only after `<tool> --version` proves it dispatches, and applies
51
+ the same check to `uv` itself.
52
+
53
+ - **The `uv` fallback stopped leaking back to `PATH`.** It ran `uv run
54
+ <tool>`, which falls back to `PATH` when the project environment has
55
+ no such tool — landing on the very shim that had just been rejected.
56
+ It is now `uv run --with <tool> <tool>`, so the tool is always present
57
+ in the run's overlay; a version pinned by the project still wins,
58
+ since uv resolves the overlay against the project's requirements.
59
+
60
+ - **The 127 message names the fix.** It now says what to install
61
+ (`uv add --dev ruff`, or `"tempest-cli[tools]"` for the set) instead
62
+ of only reporting that `PATH` and `uv` came up empty.
63
+
64
+ ## [0.1.0] — 2026-08-15
65
+
66
+ First release. Extracted from
67
+ [`tempest-fastapi-sdk`](https://github.com/mauriciobenjamin700/tempest-fastapi-sdk),
68
+ where the same gate shipped as `tempest check` — reachable only by
69
+ installing a FastAPI SDK.
70
+
71
+ ### Added
72
+
73
+ - **The quality gate**: `lint`, `fix`, `format`, `fmt-check`, `type`,
74
+ `test` and `check`, over `ruff` / `mypy` / `pytest`. Each returns the
75
+ underlying tool's exit code; `check` runs the four in order and stops
76
+ at the first failure.
77
+
78
+ - **Typing strictness as configuration**, read from `[tool.tempest]
79
+ typing_strictness` in `pyproject.toml` (`lenient` | `standard` |
80
+ `strict`, defaulting to `standard`), with a `--strictness` / `-s`
81
+ override per run. Levels only ever **add** flags on top of the
82
+ project's own `[tool.ruff]` / `[tool.mypy]`. `ANN401` is never enabled
83
+ at any level: `Any` is a legitimate annotation.
84
+
85
+ - **`pr-prompt`** — builds the prompt that makes an AI write a branch's
86
+ pull-request description, carrying the repository's own PR template
87
+ (or a bundled PT-BR / EN-US default), the rules that stop a model from
88
+ returning the template unfilled, and the branch context read as
89
+ `base...head`.
90
+
91
+ - **A library surface**: `run_full_check`, `run_ruff_check`,
92
+ `run_ruff_fix`, `run_ruff_format`, `run_mypy`, `run_pytest`,
93
+ `load_tempest_config`, `find_pyproject`, `generate_pr_prompt`.
94
+
95
+ - **`register_commands(app)`** mounts the whole gate onto an existing
96
+ `typer.Typer`, so another CLI exposes these commands under its own
97
+ name without copying a body. `tempest-fastapi-sdk` uses exactly this,
98
+ which is what keeps `tempest check` and `tempest-cli check` identical.
99
+
100
+ ### Notes
101
+
102
+ - The only runtime dependency is `typer`. `ruff`, `mypy` and `pytest`
103
+ are invoked from the active environment (or through `uv run` when they
104
+ are not on `PATH`), so the project pins the versions it wants. The
105
+ `[tools]` extra installs all three for whoever prefers that.
106
+ - Measured against the SDK it came from: reaching these commands there
107
+ loaded 38.7 MB of dependencies and about 0.5 s of import time per
108
+ invocation — for four commands that touch none of it. A test in this
109
+ package asserts that importing it pulls no web framework.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: tempest-cli
3
- Version: 0.1.0
3
+ Version: 0.3.0
4
4
  Summary: Framework-agnostic quality gate for Python projects: ruff + mypy + pytest behind one command, with a typing-strictness dial and a PR-description prompt generator.
5
5
  Project-URL: Homepage, https://github.com/mauriciobenjamin700/tempest-cli
6
6
  Project-URL: Repository, https://github.com/mauriciobenjamin700/tempest-cli
@@ -22,11 +22,11 @@ Classifier: Topic :: Software Development :: Quality Assurance
22
22
  Classifier: Topic :: Utilities
23
23
  Classifier: Typing :: Typed
24
24
  Requires-Python: >=3.11
25
+ Requires-Dist: ruff>=0.8.0
25
26
  Requires-Dist: typer>=0.12.0
26
27
  Provides-Extra: tools
27
28
  Requires-Dist: mypy>=1.13.0; extra == 'tools'
28
29
  Requires-Dist: pytest>=8.3.3; extra == 'tools'
29
- Requires-Dist: ruff>=0.8.0; extra == 'tools'
30
30
  Description-Content-Type: text/markdown
31
31
 
32
32
  # tempest-cli
@@ -42,7 +42,8 @@ One command for the quality gate of any Python project — `ruff` +
42
42
  `pyproject.toml` instead of in four different Makefile targets.
43
43
 
44
44
  Framework-agnostic on purpose: Django, Flask, Litestar, FastAPI, a
45
- library, a script. The only runtime dependency is `typer`.
45
+ library, a script. It brings `ruff` along, so the gate runs the moment
46
+ you install it; `typer` is the only other runtime dependency.
46
47
 
47
48
  ```bash
48
49
  uv add --dev tempest-cli
@@ -50,6 +51,8 @@ uv add --dev tempest-cli
50
51
  tempest-cli check # lint + fmt-check + type + test, in order, stops at the first failure
51
52
  tempest-cli fix # every ruff autofix, then format
52
53
  tempest-cli type -s strict # override the configured strictness for one run
54
+
55
+ tc check # `tc` is the short alias for the same program
53
56
  ```
54
57
 
55
58
  ## Why it exists
@@ -139,16 +142,33 @@ cli: typer.Typer = typer.Typer(name="mytool")
139
142
  register_commands(cli)
140
143
  ```
141
144
 
142
- ## Installing the tools
145
+ ## Where the tools come from
146
+
147
+ **`ruff` comes with the package** — six of the eight commands are ruff,
148
+ so `lint`, `fix`, `format` and `fmt-check` work straight after
149
+ `uv add --dev tempest-cli`, with nothing else to install. It is a static
150
+ binary wheel with no Python dependencies of its own, so nothing of its
151
+ propagates into your resolution.
143
152
 
144
- `tempest-cli` shells out to whatever `ruff`, `mypy` and `pytest` it
145
- finds — it does not pin them, so your project chooses the versions. To
146
- install them alongside it:
153
+ `mypy` and `pytest` are deliberately left to you — a mypy bump changes
154
+ which errors your code reports, and pytest has to match your plugins and
155
+ your suite. Add them yourself, or take the bundle:
147
156
 
148
157
  ```bash
149
158
  uv add --dev "tempest-cli[tools]"
150
159
  ```
151
160
 
161
+ Whatever you pin wins over the bundled ruff. The lookup runs in this
162
+ order:
163
+
164
+ 1. the project's environment — `$VIRTUAL_ENV`, then the nearest `.venv`
165
+ up the tree;
166
+ 2. the environment `tempest-cli` itself runs from (where the bundled
167
+ ruff lives);
168
+ 3. `PATH`, skipping a pyenv/asdf shim that dispatches nowhere (the one
169
+ that answers `pyenv: ruff: command not found`);
170
+ 4. `uv run --with <tool> <tool>`, when `uv` is available.
171
+
152
172
  ## Relationship with tempest-fastapi-sdk
153
173
 
154
174
  This package was extracted from
@@ -11,7 +11,8 @@ One command for the quality gate of any Python project — `ruff` +
11
11
  `pyproject.toml` instead of in four different Makefile targets.
12
12
 
13
13
  Framework-agnostic on purpose: Django, Flask, Litestar, FastAPI, a
14
- library, a script. The only runtime dependency is `typer`.
14
+ library, a script. It brings `ruff` along, so the gate runs the moment
15
+ you install it; `typer` is the only other runtime dependency.
15
16
 
16
17
  ```bash
17
18
  uv add --dev tempest-cli
@@ -19,6 +20,8 @@ uv add --dev tempest-cli
19
20
  tempest-cli check # lint + fmt-check + type + test, in order, stops at the first failure
20
21
  tempest-cli fix # every ruff autofix, then format
21
22
  tempest-cli type -s strict # override the configured strictness for one run
23
+
24
+ tc check # `tc` is the short alias for the same program
22
25
  ```
23
26
 
24
27
  ## Why it exists
@@ -108,16 +111,33 @@ cli: typer.Typer = typer.Typer(name="mytool")
108
111
  register_commands(cli)
109
112
  ```
110
113
 
111
- ## Installing the tools
114
+ ## Where the tools come from
115
+
116
+ **`ruff` comes with the package** — six of the eight commands are ruff,
117
+ so `lint`, `fix`, `format` and `fmt-check` work straight after
118
+ `uv add --dev tempest-cli`, with nothing else to install. It is a static
119
+ binary wheel with no Python dependencies of its own, so nothing of its
120
+ propagates into your resolution.
112
121
 
113
- `tempest-cli` shells out to whatever `ruff`, `mypy` and `pytest` it
114
- finds — it does not pin them, so your project chooses the versions. To
115
- install them alongside it:
122
+ `mypy` and `pytest` are deliberately left to you — a mypy bump changes
123
+ which errors your code reports, and pytest has to match your plugins and
124
+ your suite. Add them yourself, or take the bundle:
116
125
 
117
126
  ```bash
118
127
  uv add --dev "tempest-cli[tools]"
119
128
  ```
120
129
 
130
+ Whatever you pin wins over the bundled ruff. The lookup runs in this
131
+ order:
132
+
133
+ 1. the project's environment — `$VIRTUAL_ENV`, then the nearest `.venv`
134
+ up the tree;
135
+ 2. the environment `tempest-cli` itself runs from (where the bundled
136
+ ruff lives);
137
+ 3. `PATH`, skipping a pyenv/asdf shim that dispatches nowhere (the one
138
+ that answers `pyenv: ruff: command not found`);
139
+ 4. `uv run --with <tool> <tool>`, when `uv` is available.
140
+
121
141
  ## Relationship with tempest-fastapi-sdk
122
142
 
123
143
  This package was extracted from
@@ -0,0 +1,71 @@
1
+ # Changelog
2
+
3
+ The full history lives in the repository's
4
+ [`CHANGELOG.md`](https://github.com/mauriciobenjamin700/tempest-cli/blob/main/CHANGELOG.md).
5
+
6
+ ## [0.3.0] — 2026-08-15
7
+
8
+ ### Changed
9
+
10
+ - **`ruff` now ships with the package.** It left the `[tools]` extra for
11
+ the runtime dependencies, so `uv add --dev tempest-cli` is enough for
12
+ `lint`, `fix`, `format` and `fmt-check` to run. The cost is nil: ruff
13
+ is a static binary wheel with no Python dependencies of its own, so no
14
+ bound of its reaches a consumer's resolution. `mypy` and `pytest` stay
15
+ out on purpose; `[tools]` now installs exactly those two.
16
+ - **The project's environment is searched before the CLI's own.** With
17
+ ruff bundled, the CLI's environment always has one — looking there
18
+ first would silently override a version the project pinned whenever
19
+ `tempest-cli` lives apart from it (`uv tool install`, pipx). The order
20
+ is now `$VIRTUAL_ENV` → nearest `.venv` → the CLI's environment →
21
+ `PATH` → `uv run --with`.
22
+
23
+ ## [0.2.0] — 2026-08-15
24
+
25
+ ### Added
26
+
27
+ - **`tc`**, a short alias installed next to `tempest-cli` — the same
28
+ program. While the installing environment is on `PATH` it shadows
29
+ iproute2's `tc(8)` (call `/usr/sbin/tc` for the network one).
30
+
31
+ ### Fixed
32
+
33
+ - **The gate no longer runs a dead pyenv/asdf shim.** `tempest-cli fix`
34
+ in a project without ruff answered `pyenv: ruff: command not found`
35
+ and exited 127. The lookup now searches the run's own environments
36
+ first (the CLI's interpreter directory, `$VIRTUAL_ENV`, the nearest
37
+ `.venv`) and accepts a shim only after `<tool> --version` proves it
38
+ dispatches — the same check applies to `uv` itself.
39
+ - **The `uv` fallback stopped leaking back to `PATH`.** It was `uv run
40
+ <tool>`, which falls back to `PATH` when the project environment has
41
+ no such tool — landing on the shim just rejected. It is now `uv run
42
+ --with <tool> <tool>`.
43
+ - **The 127 message names the fix** (`uv add --dev ruff`, or
44
+ `"tempest-cli[tools]"` for the set).
45
+
46
+ ## [0.1.0] — 2026-08-15
47
+
48
+ First release. Extracted from
49
+ [`tempest-fastapi-sdk`](https://github.com/mauriciobenjamin700/tempest-fastapi-sdk),
50
+ where the same gate shipped as `tempest check` — reachable only by
51
+ installing a FastAPI SDK.
52
+
53
+ ### Added
54
+
55
+ - The gate: `lint`, `fix`, `format`, `fmt-check`, `type`, `test` and
56
+ `check`.
57
+ - Typing strictness through `[tool.tempest] typing_strictness`, with a
58
+ `--strictness` override per run.
59
+ - `pr-prompt` — the prompt that makes an AI write the PR description.
60
+ - A library surface (`run_full_check`, `load_tempest_config`,
61
+ `generate_pr_prompt`, …) and `register_commands(app)` to mount the
62
+ gate on another CLI.
63
+
64
+ ### Notes
65
+
66
+ - The only runtime dependency is `typer`. The tools come from the
67
+ project environment.
68
+ - Measured against the SDK it came from: reaching these commands there
69
+ loaded 38.7 MB of dependencies and ~0.5 s of import time per
70
+ invocation. A test in this package asserts that importing it pulls no
71
+ web framework.
@@ -0,0 +1,71 @@
1
+ # Changelog
2
+
3
+ O histórico completo vive no
4
+ [`CHANGELOG.md`](https://github.com/mauriciobenjamin700/tempest-cli/blob/main/CHANGELOG.md)
5
+ do repositório.
6
+
7
+ ## [0.3.0] — 2026-08-15
8
+
9
+ ### Mudado
10
+
11
+ - **O `ruff` agora vem junto com o pacote.** Saiu do extra `[tools]` e
12
+ virou dependência: `uv add --dev tempest-cli` já basta para `lint`,
13
+ `fix`, `format` e `fmt-check` rodarem. Custo zero — o ruff é binário
14
+ estático, sem dependência Python, então nenhum limite dele entra na
15
+ resolução de quem instala. `mypy` e `pytest` continuam de fora de
16
+ propósito; `[tools]` agora instala exatamente esses dois.
17
+ - **O ambiente do projeto passa a ser procurado antes do da CLI.** Com o
18
+ ruff embutido, o ambiente da CLI sempre tem um — procurar ali primeiro
19
+ sobrescreveria em silêncio a versão que o projeto fixou quando o
20
+ `tempest-cli` mora fora dele (`uv tool install`, pipx). A ordem agora é
21
+ `$VIRTUAL_ENV` → `.venv` mais próximo → ambiente da CLI → `PATH` →
22
+ `uv run --with`.
23
+
24
+ ## [0.2.0] — 2026-08-15
25
+
26
+ ### Adicionado
27
+
28
+ - **`tc`**, apelido curto instalado ao lado de `tempest-cli` — mesmo
29
+ programa. Enquanto o ambiente instalador estiver no `PATH`, ele
30
+ sombreia o `tc(8)` do iproute2 (chame `/usr/sbin/tc` para o de rede).
31
+
32
+ ### Corrigido
33
+
34
+ - **O gate não roda mais um shim morto do pyenv/asdf.** `tempest-cli
35
+ fix` num projeto sem ruff respondia `pyenv: ruff: command not found` e
36
+ saía 127. A busca agora tenta primeiro os ambientes da execução
37
+ (diretório do interpretador da CLI, `$VIRTUAL_ENV`, `.venv` mais
38
+ próximo) e só aceita um shim depois que `<ferramenta> --version` prova
39
+ que ele despacha — o mesmo vale para o próprio `uv`.
40
+ - **O fallback do `uv` parou de vazar para o `PATH`.** Era `uv run
41
+ <ferramenta>`, que cai no `PATH` quando o ambiente do projeto não tem
42
+ a ferramenta — voltando ao shim recém-rejeitado. Agora é `uv run
43
+ --with <ferramenta> <ferramenta>`.
44
+ - **A mensagem do 127 diz o que instalar** (`uv add --dev ruff`, ou
45
+ `"tempest-cli[tools]"` para as três).
46
+
47
+ ## [0.1.0] — 2026-08-15
48
+
49
+ Primeira versão. Extraída do
50
+ [`tempest-fastapi-sdk`](https://github.com/mauriciobenjamin700/tempest-fastapi-sdk),
51
+ onde o mesmo gate era o `tempest check` — alcançável só instalando um SDK
52
+ de FastAPI.
53
+
54
+ ### Adicionado
55
+
56
+ - O gate: `lint`, `fix`, `format`, `fmt-check`, `type`, `test` e
57
+ `check`.
58
+ - Rigor de tipagem por `[tool.tempest] typing_strictness`, com override
59
+ `--strictness` por execução.
60
+ - `pr-prompt` — o prompt que faz uma IA escrever a descrição do PR.
61
+ - Superfície de biblioteca (`run_full_check`, `load_tempest_config`,
62
+ `generate_pr_prompt`, …) e `register_commands(app)` para montar o gate
63
+ em outra CLI.
64
+
65
+ ### Notas
66
+
67
+ - Única dependência de runtime: `typer`. As ferramentas vêm do ambiente
68
+ do projeto.
69
+ - Medido contra o SDK de origem: chegar nesses comandos lá carregava
70
+ 38,7 MB de dependências e ~0,5 s de import por invocação. Um teste
71
+ deste pacote garante que importá-lo não puxa framework web nenhum.
@@ -14,6 +14,11 @@ tool's exit code.
14
14
  | `check` | the four above, in order, stopping at the first failure |
15
15
  | `pr-prompt` | builds the PR-description prompt — [its own page](pr-prompt.md) |
16
16
 
17
+ !!! tip "`tc` is the short form"
18
+ The package installs `tempest-cli` and `tc` pointing at the same
19
+ program. The examples use the long name; `tc check`, `tc fix` and
20
+ `tc type -s strict` work exactly the same.
21
+
17
22
  ## The full gate
18
23
 
19
24
  ```bash
@@ -63,8 +68,11 @@ The exit code is the tool's own, untranslated:
63
68
  tempest-cli lint; echo "exited $?"
64
69
  ```
65
70
 
66
- There is exactly one code of its own: **127**, when the tool is not on
67
- `PATH` and `uv` is not either — the message then names what was missing.
71
+ There is exactly one code of its own: **127**, when the tool is in none
72
+ of the places the CLI looks — the run's environment, `PATH`, `uv run
73
+ --with` — and the message then names what was missing and how to install
74
+ it. The lookup order is in
75
+ [Installation](installation.md#where-ruff-mypy-and-pytest-come-from).
68
76
 
69
77
  ## Recap
70
78
 
@@ -14,6 +14,11 @@ saída da ferramenta por baixo.
14
14
  | `check` | os quatro acima, em ordem, parando na primeira falha |
15
15
  | `pr-prompt` | monta o prompt da descrição do PR — [página própria](pr-prompt.md) |
16
16
 
17
+ !!! tip "`tc` é a forma curta"
18
+ O pacote instala `tempest-cli` e `tc` apontando para o mesmo
19
+ programa. Os exemplos usam o nome longo; `tc check`, `tc fix` e
20
+ `tc type -s strict` funcionam igual.
21
+
17
22
  ## O gate completo
18
23
 
19
24
  ```bash
@@ -63,8 +68,10 @@ O código de saída é o da ferramenta, sem tradução:
63
68
  tempest-cli lint; echo "saiu $?"
64
69
  ```
65
70
 
66
- Só há um código próprio: **127**, quando a ferramenta não está no `PATH`
67
- e o `uv` também não — aí a mensagem diz qual faltou.
71
+ Só há um código próprio: **127**, quando a ferramenta não está em nenhum
72
+ dos lugares onde a CLI procura — ambiente da execução, `PATH`, `uv run
73
+ --with` — e aí a mensagem diz qual faltou e como instalá-la. A ordem de
74
+ busca está em [Instalação](installation.md#de-onde-vem-o-ruff-o-mypy-e-o-pytest).
68
75
 
69
76
  ## Recap
70
77
 
@@ -5,11 +5,14 @@ and `pytest` — with the typing strictness living in `pyproject.toml`
5
5
  instead of spread across four Makefile targets.
6
6
 
7
7
  Framework-agnostic on purpose: Django, Flask, Litestar, FastAPI, a
8
- library, a script. The only runtime dependency is `typer`.
8
+ library, a script. There are two runtime dependencies: `typer` and
9
+ `ruff` — the latter ships along, so the gate runs the moment you install
10
+ it.
9
11
 
10
12
  ```bash
11
13
  uv add --dev tempest-cli
12
14
  tempest-cli check
15
+ tc check # the same, through the short alias
13
16
  ```
14
17
 
15
18
  ```console
@@ -5,11 +5,14 @@ Um comando para o gate de qualidade de qualquer projeto Python — `ruff`,
5
5
  em vez de espalhado por quatro alvos de Makefile.
6
6
 
7
7
  Agnóstico de framework de propósito: Django, Flask, Litestar, FastAPI,
8
- uma biblioteca, um script. A única dependência de runtime é o `typer`.
8
+ uma biblioteca, um script. As dependências de runtime são duas: o
9
+ `typer` e o `ruff` — que já vem junto, para o gate rodar assim que
10
+ instala.
9
11
 
10
12
  ```bash
11
13
  uv add --dev tempest-cli
12
14
  tempest-cli check
15
+ tc check # o mesmo, pelo apelido curto
13
16
  ```
14
17
 
15
18
  ```console
@@ -0,0 +1,107 @@
1
+ # Installation
2
+
3
+ ```bash
4
+ uv add --dev tempest-cli
5
+ ```
6
+
7
+ Or with pip:
8
+
9
+ ```bash
10
+ pip install tempest-cli
11
+ ```
12
+
13
+ Requires **Python 3.11+**. It brings `ruff` along — six of the eight
14
+ commands are ruff, so the gate runs the moment the package installs. The
15
+ other runtime dependency is `typer`.
16
+
17
+ It installs **two executables**: `tempest-cli` and the short alias `tc`.
18
+ They are the same program — everything in these docs applies to both.
19
+
20
+ ```bash
21
+ tc check # identical to tempest-cli check
22
+ ```
23
+
24
+ !!! warning "`tc` is also iproute2's `tc(8)`"
25
+ While the environment that installed the package is on `PATH`, `tc`
26
+ resolves to this CLI. For Linux traffic control, call it by absolute
27
+ path (`/usr/sbin/tc`) — or use `tempest-cli` and leave `tc` alone.
28
+
29
+ ## Where ruff, mypy and pytest come from
30
+
31
+ **`ruff` comes with the package**: install it and `lint`, `fix`,
32
+ `format` and `fmt-check` already work — nothing else to install.
33
+
34
+ ```bash
35
+ uv add --dev tempest-cli
36
+ tempest-cli fix # runs right away
37
+ ```
38
+
39
+ `mypy` and `pytest` stay with you. A mypy bump changes which errors your
40
+ code starts reporting, and pytest has to match your plugins and your
41
+ suite — those versions are the project's call. Add them yourself, or
42
+ take the bundle:
43
+
44
+ ```bash
45
+ uv add --dev "tempest-cli[tools]" # mypy + pytest
46
+ ```
47
+
48
+ !!! question "Why ruff is a dependency and the other two are not"
49
+ Six of the eight commands are ruff — a `tempest-cli` without ruff is
50
+ a gate that cannot run. And it costs nothing: ruff is a static
51
+ binary with no Python dependencies at all, so no bound of its enters
52
+ your project's resolution. mypy and pytest, in contrast, run through
53
+ your code and your suite; pinning them here would be deciding for
54
+ you.
55
+
56
+ ### The lookup order
57
+
58
+ What your project pins **wins** over the bundled ruff. The CLI runs the
59
+ first thing it finds, in this order:
60
+
61
+ 1. **the project's environment** — `$VIRTUAL_ENV`, then the nearest
62
+ `.venv` up the tree;
63
+ 2. **the CLI's own environment** — where the bundled ruff lives;
64
+ 3. **`PATH`** — skipping a version-manager shim that dispatches nowhere
65
+ (see below);
66
+ 4. **`uv run --with <tool> <tool>`** when `uv` is available — the
67
+ project's environment plus the tool, with no activation and no prior
68
+ `uv sync` required.
69
+
70
+ If nothing resolves, the command exits with **127**, naming the missing
71
+ tool and how to install it, instead of raising a traceback.
72
+
73
+ !!! info "Why `PATH` does not come first"
74
+ On a pyenv/asdf machine the `shims` directory is on `PATH`
75
+ globally and holds a stub for every tool any installed version ever
76
+ provided. Looking up `ruff` there finds `~/.pyenv/shims/ruff` even
77
+ when the project has no ruff at all — and running it prints
78
+ `pyenv: ruff: command not found`. So the run's own environments win
79
+ over `PATH`, and a shim is only accepted after proving it dispatches
80
+ (`<tool> --version` exiting `0`).
81
+
82
+ ## Verifying
83
+
84
+ ```bash
85
+ tempest-cli --version
86
+ tc --version # the same program
87
+ tempest-cli check --help
88
+ ```
89
+
90
+ ## In CI
91
+
92
+ Every command returns the underlying tool's exit code, so the job reads
93
+ it exactly as it would read `ruff` directly:
94
+
95
+ ```yaml
96
+ - name: Quality gate
97
+ run: uv run tempest-cli check
98
+ ```
99
+
100
+ ## Recap
101
+
102
+ - `uv add --dev tempest-cli`, Python 3.11+, `ruff` already included.
103
+ - `mypy` and `pytest` are yours — or take `"tempest-cli[tools]"`.
104
+ - Two executables: `tempest-cli` and the `tc` alias.
105
+ - What the project pins beats the bundled ruff; then come `PATH` (never
106
+ a dead shim) and `uv run --with`.
107
+ - A missing tool means exit 127 with a message, not a traceback.