Get the shared CI green - #219
Open
lispandfound wants to merge 1 commit into
Open
Conversation
Every failure the shared workflow reports on the previous commit, plus the four that `no_parallel` was already failing before any of this. **uv.lock.** The lock pinned numba 0.53.1 (March 2021), whose llvmlite 0.36 refuses to build on anything past Python 3.9, so `uv sync` died in deptry, pytest and typecheck alike. That was the whole of the three Python job failures on #217. Relocked, and — as asked — the rest of the lock is upgraded along with it, dev tooling included: ruff 0.16.1 to 0.16.7, ty 0.0.66 to 0.0.80, hypothesis, coverage, qcore-utils 2026.6.1 to 2026.8.2, numpy 2.5.1 to 2.5.3, and the transitive set behind them. **.python-version.** uv picked the interpreter off the runner before; the retired test.yml had pinned 3.13 through setup-python, and the shared workflow has no such step. Pinning it here keeps CI and a local checkout on the same interpreter. **ruff format.** The old ruff.yml ran `ruff check` only, so two files had never been through the formatter. **cargo fmt.** Likewise never run. Edition 2024 sorts `use` groups lowercase-last and no longer indents trailing comments to the previous expression. **deptry.** dask is declared but never imported: xarray dispatches to it when `apply_ufunc(..., dask="parallelized")` is handed a dask-backed array, which is what the `lazy` extra is for. Recorded as a DEP002 ignore. **ty.** The suppression on the invalid-shape test no longer matches any diagnostic, and ty now reports the dead directive. **numpydoc.** Seven kernel helpers in IM/ims.py and one in IM/snr_calculation.py had a summary line and nothing else. Written out in the style the neighbouring `_rotd_kernel` and `_components` already use. **lefthook.yml**, adapted from ucgmsim/nzcvm, so none of the above has to be found by CI again. Three changes to that config beyond porting it: - Split into pre-commit and pre-push. Upstream runs everything on pre-push against {staged_files}, but nothing is staged at push time: those commands report "no files for inspection" and skip, while the two that do not reference the template (clippy, rustfmt) run over the whole crate on every push. Autofix now runs on pre-commit over {staged_files}, where stage_fixed can do something, and the gates run on pre-push over {push_files}. - Added ruff-format, numpydoc and rustfmt. The shared workflow gates on all three and the nzcvm config predates that; between them they cover most of what is fixed above. - Fixed the yaml glob. `*.{yaml, yml}` has a space inside the alternation, so the second branch only ever matched a file literally named `* yml` and the hook never fired on a .yml. Now `*.{yaml,yml}`. The vale command from the nzcvm config is deliberately left out — it lands with the vale config itself in the next PR, rather than pointing at a .vale.ini that does not exist yet. **.yamllint.yml**, because that yaml hook does now fire, and yamllint's defaults flag things Actions requires: no `---` document start, `on:` as a mapping key, and long `${{ }}` expressions. **.gitignore**, which had no entry for target/, *.egg-info/, .coverage, htmlcov/, __pycache__/ or any of the tool caches. With hooks operating on staged files, `git add -A` picking those up is a live hazard. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #218. Second of three.
Takes the shared workflow from "adopted" to "passing", and adds a lefthook config so it stays that way without a round trip through Actions.
The lockfile was the big one
uv.lockpinned numba 0.53.1 (March 2021). Itsllvmlite 0.36refuses to build on anything past Python 3.9:uv synctherefore died indeptry,pytestandtypecheckalike — all three Python-job failures on #217 were this one line. Relocked, and as asked the whole lock is upgraded alongside it, dev tooling included: ruff 0.16.1 → 0.16.7, ty 0.0.66 → 0.0.80, qcore-utils 2026.6.1 → 2026.8.2, numpy 2.5.1 → 2.5.3, plus hypothesis, coverage, dask, scipy and the transitive set behind them.Everything else the workflow was failing
ruff format --checkruff.ymlranruff checkonly.cargo fmt --all --checkusegroups lowercase-last and stopped indenting trailing comments to the previous expression.deptryDEP002 dask. It is never imported: xarray dispatches to it whenapply_ufunc(..., dask="parallelized")gets a dask-backed array, which is what thelazyextra exists for. Recorded as a per-rule ignore with that reasoning.ty check# ty: ignore[invalid-argument-type]on the invalid-shape test no longer suppresses anything, and ty reports the dead directive.numpydoc lintIM/ims.pyand one inIM/snr_calculation.pyhad a summary line and noParameters/Returns. Written in the style_rotd_kerneland_componentsalready use..python-versionpins 3.13. The retiredtest.ymlpinned it viasetup-python; the shared workflow has no such step, so uv was picking whatever the runner happened to offer.lefthook
Ported from ucgmsim/nzcvm, with three changes:
pre-commitandpre-push. Upstream runs everything onpre-pushagainst{staged_files}— but nothing is staged at push time. Verified against the real config: five of its seven commands print(skip) no files for inspection, and the two that do not reference the template (clippy,rustfmt) instead run over the whole crate on every push. Autofix now runs onpre-commitover{staged_files}, wherestage_fixedcan do something; the gates run onpre-pushover{push_files}, lefthook's pre-push equivalent.ruff-format,numpydocandrustfmt. The shared workflow gates on all three; the nzcvm config predates it. Between them they cover most of what is fixed above.*.{yaml, yml}has a space inside the alternation, so the second branch only ever matched a file literally named* yml— the hook never fired on a.yml. Now*.{yaml,yml}. All three are worth carrying back to nzcvm.Install with
uvx lefthook install. This branch was pushed through its ownpre-pushhook.The
valecommand from the nzcvm config is deliberately not here: it lands with the vale config itself in PR 3, rather than pointing at a.vale.inithat does not exist yet.Two configs follow from that hook set:
.yamllint.yml— with the yaml glob fixed the hook now actually runs, and yamllint's defaults flag things Actions requires: no---document start,on:read as the YAML 1.1 boolean, and long${{ }}expressions..gitignore— had no entry fortarget/,*.egg-info/,.coverage,htmlcov/,__pycache__/or any tool cache. With hooks working off staged files,git add -Ahoovering those up is a live hazard.Verified locally
On Python 3.13, every job the shared workflow runs:
ruff check,ruff format --check,deptry .,ty check,numpydoc lint,cargo fmt --all --check,cargo clippy --all-targets -- -D warnings,cargo test,cargo test --doc, andpytest --cov=IM tests— 62 passed, 97% coverage against the 95% gate.🤖 Generated with Claude Code