CI typecheck job fails: 273 mypy errors in easystitch src/ #72
Labels
No labels
blocked:children
blocked:depends-101
blocked:depends-103
blocked:depends-104
blocked:needs-attention
blocked:needs-decision
blocked:no-changes
blocked:preflight
bug
chore
feature-request
in-progress
lint-cleanup
needs-decompose
performance
quality
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/easystitch#72
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The
Lint & Type Checkworkflow in.forgejo/workflows/ci.ymlrunsmypy src/ --ignore-missing-imports --no-error-summaryas the Type Check job. As of commitf456bc7(CI path correction + ruff format), this job produces 273 mypy errors across 34 files and exits non-zero.This blocks PR merges via the required CI check. The Lint sub-step (
ruff check .) and Tests (pytest tests/ -q) both pass. The pipeline itself (kilo-gsd) is not blocked — its Lint gate isruffonly — but a clean CI baseline is required for the pipeline to be useful for anything that produces a PR.Error Breakdown (mypy src/, default flags + --ignore-missing-imports)
Files with the most errors (top 10):
Cause
The codebase is ~30K LOC of Python with type hints on many function signatures but no enforcement until now. mypy default mode is being applied (
pyproject.toml [tool.mypy]only setsignore_missing_imports = trueandno_error_summary = true). Some errors are real type bugs; others are incomplete annotation coverage; a smaller subset is env-version drift in Pillow/skimage APIs.Fix
Bring mypy src/ to zero errors while preserving run-time behavior. Strategy:
pyproject.toml:[[tool.mypy.overrides]]for modules that are intentionally untyped (# type: ignoreis fine for env-version drift on third-party APIs).disallow_untyped_defs = falsefor now; flip totruemodule-by-module as coverage improves.ignore_missing_imports = true.src/main_pipeline.py,src/embroidery_converter/,src/output_generators/,src/machine/,src/raster/).# type: ignore[error-code]for env-version drift where the code works at runtime but the typing library disagrees (e.g.MEDIANCUTonImage.Quantize).var-annotatederrors.mypy src/ --ignore-missing-imports --no-error-summarycommand used in CI.Acceptance
mypy src/ --ignore-missing-imports --no-error-summaryexits 0.ruff check .andpytest tests/ -qstill pass (regression check).Scope / Out of Scope
In scope: Reduce mypy error count to zero on
src/.Out of scope: Adding tests for code paths that have none today; re-typing
tests/; introducing strict mode module-by-module (track as a follow-up issue).Files likely touched
Context
Mark/easystitchmainatf456bc7mypy src/ --ignore-missing-imports --no-error-summary(matches.forgejo/workflows/ci.ymlline ~55)mypy src/ --ignore-missing-imports | grep -E '^src/' | awk '{print $1}' | sort | uniq -c | sort -rnAuto-triage: needs decompose
Marked
triage-approved+needs-decompose. decompose-executor will pick this up and break it into implementable sub-issues.Auto-triage: needs decompose
Marked
triage-approved+needs-decompose. decompose-executor will pick this up and break it into implementable sub-issues.