Repository navigation
Clear all 8 mypy errors in manifest_parser.py (#432 session 10) - #454
Merged
Merged
Conversation
locate_physical_package() is declared to return Path, but 6 of its
ecosystem branches (npm resolve failure, packagist/golang miss,
rubygems/maven not-found, and the final fallthrough) legitimately
return None when a declared package isn't found on disk -- that's
the expected "not verified locally" outcome, not an error path.
Its only caller (sbom_recorder.py:114) already handles this
correctly with `if not pkg_path:`. The signature was simply wrong;
fixed by widening it to Optional[Path], which matches the real
contract instead of forcing a cast/ignore to hide it.
resolution_map (build_resolution_map) needed an explicit
Dict[str, Dict[str, str]] annotation -- a nested nothing-to-infer-from
{} accumulator, same shape as prior sessions' local-dict fixes.
Baseline: 57 -> 49 unique entries.
Contributor
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
Session 10 of the mypy cleanup epic (#432).
locate_physical_package()is declared to returnPath, but 6 of its ecosystem branches (npm resolve failure, packagist/golang miss, rubygems/maven not-found, and the final fallthrough) legitimately returnNonewhen a declared package isn't found on disk -- that's the expected "not verified locally" outcome, not an error path. Its only caller (sbom_recorder.py:114) already handles this correctly withif not pkg_path:. The signature was simply wrong; fixed by widening it toOptional[Path], matching the real contract instead of forcing a cast/ignore to paper over it.resolution_mapinbuild_resolution_map()needed an explicitDict[str, Dict[str, str]]annotation -- a nested{}accumulator with nothing for mypy to infer from, same shape as prior sessions' local-dict fixes.Baseline: 57 -> 49 unique entries.
Test plan
mypy gitgalaxy/ --ignore-missing-imports(fresh.mypy_cache) in the CI-matching minimal venv: all 8 errors resolved, no fan-out regressions elsewherepython tests/mypy_audit.py --ci: passes against the regenerated 49-entry baselineflake8 . --count --select=E9,F63,F7,F82: 0python tests/dead_key_audit.py --ci: no new findingspytest tests/ -qin the full-precision venv: run in progress, will confirm green before merge🤖 Generated with Claude Code