Skip to content

Coverage on packaging Mojo extensions for Python #6

@Olobir

Description

@Olobir

Thank you for the Miji Book @forfudan .

It is a great resource for users like me who are new to Mojo.

Mojo is becoming more user-friendly recently when it comes to extending Mojo for Python.
According to the Modular documentation, you can build Mojo extension modules for Python in two ways:

  • Using source files that are compiled on demand via the Python Mojo importer hook.
  • Using pre-built .so dynamic libraries for Python extension modules.

To build a module extension (note: the source file must be a .mojo file), you can run:
mojo build mojo_module.mojo --emit shared-lib -o mojo_module.so

I was wondering if there is already a way to build a Mojo extension for Python from a package (not a single module).
It would be great to have some coverage on this topic, too.

Thanks again for all the great work!

https://docs.modular.com/mojo/manual/python/mojo-from-python/#building-mojo-extension-modules

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions