Skip to content

fix: map mace imports to mace-torch - #10594

Open
alchem0x2A wants to merge 2 commits into
marimo-team:mainfrom
alchem0x2A:fix/mace-package-mapping
Open

fix: map mace imports to mace-torch#10594
alchem0x2A wants to merge 2 commits into
marimo-team:mainfrom
alchem0x2A:fix/mace-package-mapping

Conversation

@alchem0x2A

@alchem0x2A alchem0x2A commented Aug 19, 2026

Copy link
Copy Markdown

📝 Summary

Closes #10585

marimo currently infers the missing mace import as the unrelated PyPI package mace. The mace namespace used by mace.calculators is provided by mace-torch.

This PR adds the macemace-torch package mapping and tests both the forward and reverse mappings.

📋 Pre-Review Checklist

  • For large changes, or changes that affect the public API: this change was discussed or approved through issue Question for maintaining the module_name_to_pypi_name.py #10585.
  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • Video or media evidence is provided for any visual changes (not applicable; no visual changes).

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes (not applicable; no API or documentation changes).
  • Tests have been added for the changes made.

Copilot AI lite review requested due to automatic review settings August 19, 2026 20:58
@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview Aug 20, 2026 12:06am

Request Review

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes dependency inference for the mace import namespace by mapping it to the correct PyPI distribution (mace-torch) instead of the unrelated mace package. This improves the accuracy of marimo’s “missing import → installable package” resolution, including when writing PEP 723 script metadata.

Changes:

  • Add "mace": "mace-torch" to the module→PyPI package mapping registry.
  • Add unit tests covering both module→package and package→module resolution for the new mapping.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
marimo/_runtime/packages/module_name_to_pypi_name.py Adds the macemace-torch mapping entry used by canonicalization logic.
tests/_runtime/packages/test_pypi_package_manager.py Extends existing mapping tests to validate forward and reverse resolution for mace-torch.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@akshayka akshayka added the enhancement New feature or request label Aug 19, 2026
@akshayka

Copy link
Copy Markdown
Contributor

Thanks @alchem0x2A. Can you add a comment with

I have read the CLA Document and I hereby sign the CLA

to sign the CLA?

@alchem0x2A

Copy link
Copy Markdown
Author

thx @akshayka I have read the CLA. cheers

assert mgr.module_to_package("marimo") == "marimo"
assert mgr.module_to_package("123_456_789") == "123-456-789"
assert mgr.module_to_package("sklearn") == "scikit-learn"
assert mgr.module_to_package("mace") == "mace-torch"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need the test- but thank you!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx! Was just testing the CI. Indeed can revert to the minimal tests marimo currently has

@alchem0x2A

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Question for maintaining the module_name_to_pypi_name.py

4 participants