Skip to content

"Lexer is not generic" when making Python module a feature #1400

Discussion options

You must be logged in to vote

maturin relies on cargo metadata output to determine which bindings you are using, so making pyo3 optional would hide it from cargo 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.

[build-system]
requires = ["maturin>=0.14,<0.15"]
build-backend = "maturin"

[tool.maturin]
features = ["python-module"]

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

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@messense
Comment options

@GuillaumeDesforges
Comment options

@GuillaumeDesforges
Comment options

@messense
Comment options

@GuillaumeDesforges
Comment options

Answer selected by GuillaumeDesforges
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants