"Lexer is not generic" when making Python module a feature #1400
-
I'm trying to make very simple Python bindings to tweag/nickel, which works in GuillaumeDesforges/nickel@23234df Now, if I try to make it optional (GuillaumeDesforges/nickel@6386585), so that one can build the library without the Python bindings,
I use maturin version To reproduce, you can clone my branch https://github.com/GuillaumeDesforges/nickel/tree/python, then
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
maturin relies on What you can do is adding a [build-system]
requires = ["maturin>=0.14,<0.15"]
build-backend = "maturin"
[tool.maturin]
features = ["python-module"] |
Beta Was this translation helpful? Give feedback.
maturin relies on
cargo metadata
output to determine which bindings you are using, so making pyo3 optional would hide it fromcargo metadata
by default so maturin detects the wrong bindings.What you can do is adding a
pyproject.toml
and tell maturin that you want to enable the pyo3 feature.See also https://pyo3.rs/v0.17.3/faq#i-cant-run-cargo-test-or-i-cant-build-in-a-cargo-workspace-im-having-linker-issues-like-symbol-not-found-or-undefined-reference-to-_pyexc_systemerror