Skip to content

feat(prewarm): add known package-to-import-name mapping#1610

Merged
rgbkrk merged 2 commits intomainfrom
fix/prewarm-import-mapping
Apr 7, 2026
Merged

feat(prewarm): add known package-to-import-name mapping#1610
rgbkrk merged 2 commits intomainfrom
fix/prewarm-import-mapping

Conversation

@rgbkrk
Copy link
Copy Markdown
Member

@rgbkrk rgbkrk commented Apr 7, 2026

Summary

  • Adds _KNOWN_IMPORT_NAMES lookup table for common packages where the pip name doesn't match the import name (Pillow→PIL, scikit-learn→sklearn, pyyaml→yaml, etc.)
  • normalize_module_name() checks the table before falling back to the hyphen→underscore heuristic

Test plan

  • 15 Python tests pass (uv pip install -e python/prewarm && uv run pytest python/prewarm/tests/ -v)
  • New test: test_normalize_known_packages covers all table entries
  • Lint clean (cargo xtask lint)

rgbkrk added 2 commits April 7, 2026 01:56
Pip package names don't always match import names (Pillow→PIL,
scikit-learn→sklearn, pyyaml→yaml, etc.). Add a lookup table for
common data-science and notebook packages that normalize_module_name()
checks before falling back to the hyphen→underscore heuristic.
@rgbkrk rgbkrk merged commit 8d9f3c4 into main Apr 7, 2026
26 checks passed
@rgbkrk rgbkrk deleted the fix/prewarm-import-mapping branch April 7, 2026 09:05
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