Skip to content

fix: resolve mypy config drift between pyproject.toml and CI - #110

Open
shrdgn wants to merge 1 commit into
mainfrom
claude/mypy-config-drift
Open

fix: resolve mypy config drift between pyproject.toml and CI#110
shrdgn wants to merge 1 commit into
mainfrom
claude/mypy-config-drift

Conversation

@shrdgn

@shrdgn shrdgn commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • pyproject.toml's [tool.mypy] section (ignore_missing_imports = true) does not suppress PyYAML's import-untyped error (that flag only covers import-not-found), so running mypy openfusion/ exactly as configured fails locally with Library stubs not installed for "yaml".
  • CI's .github/workflows/ci.yml only passes because it appends undocumented --ignore-missing-imports --disable-error-code import-untyped --exclude openfusion/cli.py flags on the command line — none of which are reflected in pyproject.toml, so the config a contributor reads doesn't match what actually runs.
  • Fixes it properly by adding types-PyYAML to the dev extra (installing the real stubs, not just suppressing the error) and simplifying the CI step to mypy openfusion/, relying on pyproject.toml's existing exclude = ["openfusion/cli\\.py"] for the CLI exclusion (verified it still excludes cli.py — 23 source files checked either way).

Why it matters

Any contributor who runs mypy openfusion/ locally (the natural thing to do, since that's what pyproject.toml configures) gets a spurious failure that only "works" in CI because of an undocumented flag combination. This is a small, config-only fix so local and CI mypy runs behave identically.

Test plan

  • python -m mypy openfusion/ — passes cleanly (Success: no issues found in 23 source files), same file count as with the old CLI flags
  • pytest -q — 451 passed
  • ruff check .

Generated by Claude Code

pyproject.toml's [tool.mypy] (ignore_missing_imports = true) doesn't
suppress PyYAML's import-untyped error, so running `mypy openfusion/`
as documented failed locally. CI only passed because it silently
appended --ignore-missing-imports --disable-error-code import-untyped
on the command line, which existed nowhere else and masked the drift.

Add types-PyYAML to the dev extra (the actual fix for the missing
stubs) and drop the redundant CLI flags so `mypy openfusion/` behaves
identically locally and in CI.
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.

2 participants