From c02ee3cff1cb7d4241667eb851c9e1707d519299 Mon Sep 17 00:00:00 2001 From: "lf-releng-code-monkey-bot[bot]" <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com> Date: Mon, 23 Nov 2026 09:48:14 +0000 Subject: [PATCH] Chore(pre-commit): Remove the pytest hook The pytest hook was a stop-gap to keep local agent sessions from pushing code with failing tests. CI runs the suite through build-test.yaml, so the hook goes. Remove its ci.skip entry too: the organisation linting workflow fails any run whose ci.skip names a hook the configuration does not define. Drop the comments that explained the hook, and say in CONTRIBUTING.md that the hooks do not run the tests: run 'uv run pytest' locally. Review round 1: the antagonistic review noted that build-test.yaml skips pull requests touching only .github/, root dotfiles or tox.ini, so CI does not run the tests on every pull request. CONTRIBUTING.md now names those path filters and keeps the local pytest instruction. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 17 ----------------- CONTRIBUTING.md | 10 +++++++--- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 30dbadb..76c688e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,16 +8,12 @@ ci: # aislop also runs engines that can call the network at scan time # (dependency audits), so it cannot run in the sandbox either. # - # pytest runs through 'uv run' against the project's own environment, - # which the sandbox does not provide. - # # Adapted from actions-template for a Python-only repository: the # template's eslint and Go hooks, and the manifest guard they share, # are omitted because this repository has no JavaScript or Go sources. skip: - gha-workflow-linter - aislop - - pytest autofix_commit_msg: | Chore: Pre-commit autofixes @@ -240,19 +236,6 @@ repos: pass_filenames: false always_run: true - # Run the unit tests before each commit. A local system hook using the - # project's own uv environment, so it needs 'uv sync --extra dev' first; - # skipped on pre-commit.ci (see ci.skip above). - - repo: local - hooks: - - id: pytest - name: pytest - entry: uv - args: [run, pytest, --tb=short, -q] - language: system - pass_filenames: false - always_run: true - - repo: https://github.com/python-jsonschema/check-jsonschema rev: 39478bf2c099a58683d3f1aedf675105318b078d # frozen: 0.39.0 hooks: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dc37bab..2c7e81b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -82,9 +82,13 @@ prek run --files ``` The hooks include ruff, mypy, basedpyright, markdownlint, write-good, -shellcheck, actionlint, gitleaks, reuse, gitlint and pytest. basedpyright -checks the whole project and fails on warnings as well as errors. Do not -bypass the hooks with `--no-verify`. +shellcheck, actionlint, gitleaks, reuse and gitlint. basedpyright checks +the whole project and fails on warnings as well as errors. Do not bypass +the hooks with `--no-verify`. The hooks do not run the tests. Run +`uv run pytest` locally before you push. CI runs the tests too, but +only on pull requests that change a file outside `.github/`, the root +dotfiles and `tox.ini`; see the path filters in +`.github/workflows/build-test.yaml`. ### Commit Messages