chore(ci): green the lint, typecheck, and test jobs - #33
Merged
Conversation
main's CI was red across all three quality gates. This gets them green.
lint (ruff):
- `ruff format .` — reformat the 36 drifted files to the project style.
- `ruff check .` fixes: import sorting (I001), unused imports (F401), the
missing StepStmt import in validator.py (F821), `re.split(..., maxsplit=1)`
(B034), `raise … from e` (B904), percent→f-string (UP031/UP032), and an
unused test local (F841).
typecheck (mypy) — 17 errors → 0:
- validator.py: import StepStmt; int() of a validated integer literal.
- runtime/base_runner.py: annotate _provided_envs_cache as `list[Any] | None`.
- runtime/evaluator.py: drop a redundant re-annotation (no-redef).
- runtime/handlers/block_execution.py: annotate get_param results as Any
(int cap + list of loop values).
- migration/after_migrator.py: correct the stale rewrites tuple annotation
(it grew a 5th element); narrow a SourceLocation|None before .line.
- runtime/registry_runner.py: drop a call to `_update_handled_stats`, which is
a RunnerService-only method (RegistryRunner has no _handled_counts) — it would
AttributeError if that resume-completion path were reached. The lighter
RegistryRunner simply doesn't record handled stats.
- mapserver.py: type: ignore[attr-defined] on the dynamically-set server attrs.
test:
- Remove examples/osm-equity/tests/__init__.py — the only example tests package
with one; it collides with the top-level `tests` package and interrupted
collection (ModuleNotFoundError: No module named 'tests.conftest'), which had
silently excluded osm-equity's tests since Jul 16.
- With collection restored, osm-equity's tests need scipy (an optional example
dep CI doesn't install) — `pytest.importorskip("scipy"/"numpy")` so they skip
cleanly, matching how other optional-dep example tests behave.
Local: `ruff format --check .` clean, `ruff check .` clean, `mypy facetwork/`
0 errors, `pytest --collect-only` 0 collection errors; touched suites pass
(tests/runtime + after_migrator + validator: 1536 passed).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Root cause of main going red with no code change: the lint/typecheck jobs ran `pip install ruff` / `pip install mypy` UNPINNED, so a new ruff release (0.16.1) started formatting 25 files differently and the job failed `ruff format --check`. - Pin ruff==0.16.1 and mypy==2.3.0 in CI so a future release can't silently break a green main. - Reformat the 25 files the pinned ruff wants (formatting only). Verified with the pinned versions: `ruff format --check .` clean, `ruff check .` clean, `mypy facetwork/` 0 errors. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Aug 2, 2026
Closed
Owner
Author
Ready to land — the remaining red checks are pre-existing, now trackedThis PR greened lint and let the full suite run for the first time since Jul 16 (the collection interrupt had hidden everything). Result: 3616 passed, 43 skipped, coverage 77.06% (≥75%). The only remaining failures both trace to two pre-existing root causes, filed separately:
Neither is introduced by this PR; both are on |
This was referenced Aug 2, 2026
rlemke
added a commit
that referenced
this pull request
Aug 2, 2026
The `[mcp]` extra was `mcp>=1.0` (unpinned). mcp 2.0.0 shipped a breaking API change — `Tool.inputSchema` -> `Tool.input_schema` and dropped `Server.list_tools` — both of which facetwork/mcp/server.py uses. A fresh CI resolver (Python 3.11, full extras) pulled 2.0.0, producing 41 mypy errors in server.py (the typecheck job) and an AttributeError in tests/mcp/test_server.py. (A 3.12 dev box with 1.27.2 cached masked it locally.) Cap at <2 until server.py is ported to the 2.0 API. Verified in a clean Python 3.11 full-extras venv: with the cap, mcp resolves to 1.29.0, `mypy facetwork/` is 0 errors, and tests/mcp passes (160 tests). Same unpinned-dependency class as the ruff/mypy pins in #33. Fixes #34. Co-authored-by: Claude Opus 4.8 (1M context) <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.
main's CI is red across all three quality gates. This PR gets them green. No behavior changes beyond one latent-bug removal (noted below).lint (ruff)
ruff format .— reformats the 36 drifted files to project style.ruff check .fixes: import sorting (I001), unused imports (F401), a missingStepStmtimport invalidator.py(F821),re.split(…, maxsplit=1)(B034),raise … from e(B904), percent→f-string (UP031/UP032), an unused test local (F841).typecheck (mypy) — 17 errors → 0
Mostly stale/missing annotations. Notable:
after_migrator.py: therewritestuple annotation was stale (data grew a 5th element, masked by a# type: ignore); corrected it and narrowed aSourceLocation | Nonebefore.line.registry_runner.py: removed a call to_update_handled_stats— aRunnerService-only method (RegistryRunnerhas no_handled_counts). It wouldAttributeErrorif that resume-completion path were reached. The lighterRegistryRunnersimply doesn't record handled stats. (The one real latent-bug fix.)mapserver.py:# type: ignore[attr-defined]on dynamically-set server attrs (matches the existing write-site pattern).test
examples/osm-equity/tests/__init__.py— the only example tests dir with one; it collides with the top-leveltestspackage and interrupted collection (ModuleNotFoundError: No module named 'tests.conftest'), silently excluding osm-equity's tests since Jul 16.scipy(an optional example dep CI doesn't install) →pytest.importorskip("scipy"/"numpy")so they skip cleanly, matching other optional-dep example tests.Verification (local)
ruff format --check .→ clean ·ruff check .→ clean ·mypy facetwork/→ 0 errors ·pytest --collect-only→ 0 collection errorstests/runtime/+test_after_migrator+test_validator= 1536 passed.Pairs with #32 (dispatcher cache-key fix); merging both greens
main.🤖 Generated with Claude Code