Skip to content

Clear all 8 mypy errors in manifest_parser.py (#432 session 10) - #454

Merged
squid-protocol merged 1 commit into
mainfrom
fix/432-manifest-parser-typing
Jul 25, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/432-manifest-parser-typing

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

Session 10 of the mypy cleanup epic (#432).

  • 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], matching the real contract instead of forcing a cast/ignore to paper over it.
  • resolution_map in build_resolution_map() needed an explicit Dict[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 elsewhere
  • python tests/mypy_audit.py --ci: passes against the regenerated 49-entry baseline
  • flake8 . --count --select=E9,F63,F7,F82: 0
  • python tests/dead_key_audit.py --ci: no new findings
  • Full pytest tests/ -q in the full-precision venv: run in progress, will confirm green before merge

🤖 Generated with Claude Code

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.
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit cd14a44 into main Jul 25, 2026
26 checks passed
@squid-protocol
squid-protocol deleted the fix/432-manifest-parser-typing branch July 25, 2026 19:14
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.

1 participant