Skip to content

Clear mypy type errors and make the mypy CI step blocking #454

Description

@turbomam

The CI quality-checks mypy step runs with continue-on-error: true ("Don't fail build on type errors initially"). A full mypy metpo/ --ignore-missing-imports --no-strict-optional reports 223 errors across 43 files. This issue tracks clearing them so the step can become blocking.

Breakdown by error code:

  • 76 var-annotated (missing annotations, mostly mechanical)
  • 38 attr-defined (includes real bugs, e.g. a dict used where a Counter was intended → .most_common)
  • 28 operator, 26 arg-type, 24 index, 10 assignment, 7 call-overload, 6 return-value, 5 misc, 4 str, 2 valid-type, 1 dict-item

Plan: fix in batches (by file or error class) across small PRs, prioritizing the attr-defined real bugs first, then the mechanical var-annotated set, then the rest. Avoid blanket # type: ignore; add real annotations. Final step: drop continue-on-error from the mypy step in .github/workflows/python-quality.yml.

Out of scope here: the CodeQL/edit-owl findings (PR #453) and the metpo_sheet.tsv content findings (handled via the Google Sheet, with the branced upstream value and cross-ontology correction-note comments retained by design).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions