Skip to content

Treat missing lake as advisory in quality checks - #31

Merged
justincasher merged 1 commit into
mainfrom
justin/python-ci-skip-lake-test
May 10, 2026
Merged

justincasher merged 1 commit into
mainfrom
justin/python-ci-skip-lake-test

Conversation

@justincasher

Copy link
Copy Markdown
Collaborator

Summary

  • python_ci has been red on main since #d68ff1f. The job runs without a Lean toolchain, but _check_project_declarations (and _check_axioms) shell out to lake env lean unconditionally. Without lake on PATH, subprocess.run raises FileNotFoundError and the test crashes.
  • Wrap both lake invocations in try/except for FileNotFoundError and emit a single advisory _QualityError ("project declarations check skipped: `lake` not found" / "axiom audit skipped: `lake` not found") instead of crashing. Production callers still get a clear signal; the python_ci job exercises the full static check suite without aborting.
  • Adds a regression test that mocks subprocess.run to raise FileNotFoundError and asserts the advisory message is present.
  • All 69 tests pass with and without lake on PATH locally.

The python_ci job runs without a Lean toolchain, so the two
subprocess.run calls in quality.py crash with FileNotFoundError when
the binary isn't on PATH. _check_axioms is gated by --skip-lean-axioms
but _check_project_declarations is unconditional, which is why
test_quality_check_accepts_project_card_after_imports has been red
on main since #d68ff1f.

Catch FileNotFoundError around both lake invocations and emit a
single advisory error ("... skipped: `lake` not found") instead.
Production callers still get a clear signal; the python_ci job
exercises the full static check suite without crashing.
@justincasher
justincasher merged commit 79a64b0 into main May 10, 2026
4 of 5 checks passed
@Vilin97
Vilin97 deleted the justin/python-ci-skip-lake-test branch May 11, 2026 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant