-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
75 lines (74 loc) · 3.56 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
75 lines (74 loc) · 3.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Pre-push hooks: catch the failures CI can't, fast, before they reach GitHub.
#
# After cloning, run once:
# pre-commit install --hook-type pre-push
#
# Two complementary hooks run before every `git push`:
# 1. ruff-ci-mirror -- the *exact* lint command CI's lint.yml runs (pinned
# `ruff@0.15.14 check .`). Runs FIRST and takes seconds, so a lint failure
# aborts the push immediately instead of after the pytest gate (the pytest
# hook does NOT run ruff -- that gap let an F401 reach CI once).
# 2. pytest-bngsim -- the simulation-backend tests, as a fast local smoke.
# These are no longer CI-exclusive: bngsim is on public PyPI and tests.yml
# installs it, so hosted runners now run these files too (#514). The hook
# stays because it is the shortest path from "I broke the backend seam" to
# knowing it -- seconds locally instead of a CI round-trip. Run with
# `-n auto` so the whole gate finishes in well under a minute.
#
# Deliberately NOT here: the rest of the suite (`pytest -m "not slow and not
# recovery" -n auto`, ~3300 tests). CI's tests.yml runs that on every push, so
# mirroring it locally added minutes to the gate -- and a multi-minute pre-push
# hook holds the push's SSH connection idle long enough for GitHub to reap it
# ("Connection to github.com closed by remote host"), so the push silently never
# lands. Keeping the gate fast is what makes `git push` actually complete.
#
# Also NOT here: the `recovery` tier (real parameter-recovery fits through the
# backend, over an hour). That one runs nowhere automatically -- run it by hand
# when a change touches the fitting loop.
#
# `uv run --no-sync` uses the project's interpreter without touching the
# environment -- the .venv is already populated and uv.lock isn't fully
# resolved in this repo, so syncing would fail.
repos:
- repo: local
hooks:
- id: ruff-ci-mirror
name: ruff check (CI mirror)
# Mirror lint.yml exactly, pinned ruff version and all, so "green here =>
# green in CI's lint job". uvx fetches the pinned ruff without touching the
# project env. First in the list => fails fast (seconds) before the pytest gate.
entry: uvx ruff@0.15.14 check .
language: system
pass_filenames: false
always_run: true
stages: [pre-push]
- id: pytest-bngsim
name: pytest (bngsim test suite)
# Every bngsim-area test file, as a pre-push smoke (CI runs them too --
# this is the fast local copy). `-n auto` parallelizes across cores to
# keep the gate fast. Add files here as bngsim coverage expands.
entry: >-
uv run --no-sync pytest -m "not bionetgen" -n auto
tests/test_bngsim_bridge.py
tests/test_bngsim_sbml_bridge.py
tests/test_bngsim_antimony_bridge.py
tests/test_bngsim_capabilities.py
tests/test_bngsim_bngl_e2e.py
tests/test_bngsim_nf_e2e.py
tests/test_bngsim_ssa_replaces_rr.py
tests/test_bngsim_model.py
tests/test_bngsim_scan.py
tests/test_bngsim_expressions.py
tests/test_bngsim_parsing.py
tests/test_bngsim_runtime_seam.py
tests/test_bngsim_output_sensitivities.py
tests/test_gradient_routing.py
tests/test_gradient_assembly.py
tests/test_network_free_bngsim_supported.py
tests/test_stochastic_seed_policy.py
tests/test_packaging_metadata.py
tests/test_failed_sim_handling.py
language: system
pass_filenames: false
always_run: true
stages: [pre-push]