1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! 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 compiles | Who sets it |
//! |-------------|---------------|-------------|
//! | Yes | `bindings.rs` — real PyO3 extension, produces the `_native` Python module | `maturin` |
//! | No | `stub.rs` — a tiny stand-in with no Python dependency | `cargo 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`.
pub use *;
pub use *;