From f779b71e1bac99fe19075c93d8fca83cbf7cfc8e Mon Sep 17 00:00:00 2001 From: Thales Maciel Date: Sat, 14 Mar 2026 18:37:25 -0300 Subject: [PATCH] Use compileall for recursive compile checks Stop letting the explicit compile step overstate its coverage. The old py_compile globs only touched top-level modules, so syntax errors in nested packages could slip past make check and release-check.\n\nAdd a shared compile-check recipe in Makefile that runs python -m compileall -q src tests, and have both check and release-check use it so the local verification paths stay aligned. Update the GitHub Actions compile step and the matching runtime validation evidence doc to describe the same recursive compile contract.\n\nValidate with python3 -m compileall -q src tests, make check, and make release-check. --- .github/workflows/ci.yml | 2 +- Makefile | 9 ++++++--- docs/x11-ga/runtime-validation-report.md | 5 +++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78f54e2..f60453d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: uv sync --active --frozen echo "${GITHUB_WORKSPACE}/.venv/bin" >> "${GITHUB_PATH}" - name: Run compile check - run: python -m py_compile src/*.py tests/*.py + run: python -m compileall -q src tests - name: Run unit and package-logic test suite run: python -m unittest discover -s tests -p 'test_*.py' diff --git a/Makefile b/Makefile index dbdea40..3db6c38 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ BUILD_DIR := $(CURDIR)/build RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) RUN_CONFIG := $(if $(RUN_ARGS),$(abspath $(firstword $(RUN_ARGS))),$(CONFIG)) -.PHONY: run doctor self-check runtime-check eval-models build-heuristic-dataset sync-default-model check-default-model sync test check build package package-deb package-arch package-portable release-check release-prep install-local install-service install clean-dist clean-build clean +.PHONY: run doctor self-check runtime-check eval-models build-heuristic-dataset sync-default-model check-default-model sync test compile-check check build package package-deb package-arch package-portable release-check release-prep install-local install-service install clean-dist clean-build clean EVAL_DATASET ?= $(CURDIR)/benchmarks/cleanup_dataset.jsonl EVAL_MATRIX ?= $(CURDIR)/benchmarks/model_matrix.small_first.json EVAL_OUTPUT ?= $(CURDIR)/benchmarks/results/latest.json @@ -52,8 +52,11 @@ sync: test: $(PYTHON) -m unittest discover -s tests -p 'test_*.py' +compile-check: + $(PYTHON) -m compileall -q src tests + check: - $(PYTHON) -m py_compile src/*.py + $(MAKE) compile-check $(MAKE) test build: @@ -72,7 +75,7 @@ package-portable: release-check: $(MAKE) check-default-model - $(PYTHON) -m py_compile src/*.py tests/*.py + $(MAKE) compile-check $(MAKE) runtime-check $(MAKE) test $(MAKE) build diff --git a/docs/x11-ga/runtime-validation-report.md b/docs/x11-ga/runtime-validation-report.md index 3a12754..b4d79ba 100644 --- a/docs/x11-ga/runtime-validation-report.md +++ b/docs/x11-ga/runtime-validation-report.md @@ -15,8 +15,9 @@ Completed on 2026-03-12: - `PYTHONPATH=src python3 -m unittest discover -s tests -p 'test_*.py'` - confirms the runtime and diagnostics changes do not regress the broader daemon, CLI, config, and portable bundle flows -- `python3 -m py_compile src/*.py tests/*.py` - - verifies the updated runtime and diagnostics modules compile cleanly +- `python3 -m compileall -q src tests` + - verifies the updated runtime, diagnostics, and nested package modules + compile cleanly ## Automated scenario coverage