hatch-mojo

Compile .mojo sources into Python extensions during Hatch builds.

15|4|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/cofin/flow --skill hatch-mojo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hatch-mojo
Source: https://github.com/cofin/flow/tree/main/skills/hatch-mojo
Command: npx skills add https://github.com/cofin/flow --skill hatch-mojo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the compilation of .mojo source files as part of the Python package build process using the Hatch build backend.

Core Features & Use Cases

  • Build Hook Integration: Seamlessly integrates with Hatchling's build system.
  • Mojo Compilation: Compiles .mojo files into Python extensions or other specified artifacts.
  • Use Case: When developing a Python package that leverages Mojo for performance-critical components, this hook ensures those Mojo parts are correctly compiled and included in the final wheel distribution.

Quick Start

Configure your pyproject.toml to include hatch-mojo as a build dependency and define your Mojo compilation jobs.

Frequently Asked Questions about hatch-mojo

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compile .mojo sources into Python extensions during a package build?

You can compile .mojo sources into Python extensions by configuring hatch-mojo as a build dependency in your pyproject.toml, which uses Hatchling build hooks to automate the compilation process and include the artifacts in the final wheel distribution.

Can I use Hatch build hooks to generate executables and libraries from Mojo code?

Yes, Hatch build hooks support compiling Mojo code into Python extensions, executables, and libraries, managing compilation jobs and output artifact generation directly within the standard Hatchling build environment.

What is the best way to integrate Mojo compilation into Python packaging?

Integrating Mojo compilation into Python packaging is best handled by adding this build hook to your Hatchling configuration, which automates dependency management and compiles performance-critical Mojo components into the wheel.

Do I need Hatchling to build a Python package with Mojo components?

Yes, this approach relies on Hatchling as the build backend, using custom build hooks to manage Mojo compilation jobs and generate the required Python extensions or libraries for the wheel distribution.

Why does my Mojo code fail to compile when building a Python wheel?

Compilation failures often stem from incorrect build dependency configuration in pyproject.toml, as this hook requires explicit declaration of compilation jobs to properly process and generate Mojo artifacts within the Hatchling environment.

Does hatch-mojo work with standard Python wheel distributions?

Yes, hatch-mojo integrates with the standard Hatchling build system to ensure that compiled .mojo sources are correctly packaged and included as Python extensions or executables in the final wheel distribution.