fix: resolve mypy config drift between pyproject.toml and CI - #110
Open
shrdgn wants to merge 1 commit into
Open
Conversation
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.
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.
Summary
pyproject.toml's[tool.mypy]section (ignore_missing_imports = true) does not suppress PyYAML'simport-untypederror (that flag only coversimport-not-found), so runningmypy openfusion/exactly as configured fails locally withLibrary stubs not installed for "yaml"..github/workflows/ci.ymlonly passes because it appends undocumented--ignore-missing-imports --disable-error-code import-untyped --exclude openfusion/cli.pyflags on the command line — none of which are reflected inpyproject.toml, so the config a contributor reads doesn't match what actually runs.types-PyYAMLto thedevextra (installing the real stubs, not just suppressing the error) and simplifying the CI step tomypy openfusion/, relying onpyproject.toml's existingexclude = ["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 whatpyproject.tomlconfigures) 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 flagspytest -q— 451 passedruff check .Generated by Claude Code