Skip to main content

Crate _native

Crate _native 

Source
Expand description

Entrypoint for the fontlift Python extension crate.

§Two build modes

This crate compiles differently depending on whether the python-bindings Cargo feature is active:

Feature on?What compilesWho sets it
Yesbindings.rs — real PyO3 extension, produces the _native Python modulematurin
Nostub.rs — a tiny stand-in with no Python dependencycargo test --workspace

§Why the stub exists

PyO3 needs a live Python installation to link against. CI machines and developer laptops running cargo test --workspace often have neither Python nor the matching libpython. The stub satisfies the Rust type-checker and lets workspace tests pass without requiring a Python toolchain.

§How maturin uses the real bindings

When you run maturin develop or maturin build, maturin passes --features python-bindings to Cargo. That switches this crate to compile bindings.rs and link against the active Python interpreter, producing the .so / .pyd file that Python imports as fontlift._native.

Constants§

PYTHON_BINDINGS_ENABLED

Functions§

bindings_disabled_reason
Explain why the bindings are unavailable in this build.