Skip to content

airtower-luna/pyo3-hatch-experiment

Repository files navigation

pyo3-hatch-experiment

This is an experiment in combining PyO3 and Hatch, instead of using maturin or setuptools-rust. Cargo gets called via a custom build hook implemented in cargo_build.py. The hook is configured in pyproject.toml to run only for the wheel target, because there's no point in building the library for a source distribution.

What's experimental?

  • The hook assumes that the working directory of hatchling is also where the Rust package exists (with Cargo.toml, etc.), and where the compiled module for Python should be placed.
  • Using custom build targets may need some extra care depending on whether the hook should or shouldn't run. The hook class itself doesn't check the target.

About

Experiment in combining PyO3 and Hatch

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published