diff --git a/python/rust/Cargo.toml.jinja b/python/rust/Cargo.toml.jinja index 4c17f2d..c688e03 100644 --- a/python/rust/Cargo.toml.jinja +++ b/python/rust/Cargo.toml.jinja @@ -11,7 +11,7 @@ crate-type = ["cdylib"] [dependencies] {{ module }} = { path = "./rust", version = "*"{% if add_c_abi %}, optional = true{% endif %} } -pyo3 = { version = "0.29.2", features = ["abi3", "extension-module", "multiple-pymethods"] } +pyo3 = { version = "0.29.2", features = ["abi3", "multiple-pymethods"] } {% if add_c_abi %} [features] default = ["direct"] diff --git a/python/rust/pyproject.toml.jinja b/python/rust/pyproject.toml.jinja index 6b182d3..42cecca 100644 --- a/python/rust/pyproject.toml.jinja +++ b/python/rust/pyproject.toml.jinja @@ -168,6 +168,9 @@ verbose = true abi3 = true module = "{{ module }}" path = "." +{% if not add_c_abi -%} +env = { PYO3_BUILD_EXTENSION_MODULE = "1" } +{% endif -%} {% if add_c_abi -%} target-dir = "project" @@ -197,6 +200,7 @@ name = "{{ module }}" manifest = "Cargo.toml" destination = "{{ module }}/{python_extension_name}" links = ["{{ module }}_capi"] +env = { PYO3_BUILD_EXTENSION_MODULE = "1" } [tool.hatch.build.hooks.hatch-rs.artifacts.library-source-features] bundled = ["capi"] diff --git a/python/rustjswasm/Cargo.toml.jinja b/python/rustjswasm/Cargo.toml.jinja index 256190e..f42f680 100644 --- a/python/rustjswasm/Cargo.toml.jinja +++ b/python/rustjswasm/Cargo.toml.jinja @@ -11,7 +11,7 @@ crate-type = ["cdylib"] [dependencies] {{ module }} = { path = "./rust", version = "*" } -pyo3 = { version = "0.29.2", features = ["abi3", "extension-module", "multiple-pymethods"] } +pyo3 = { version = "0.29.2", features = ["abi3", "multiple-pymethods"] } [profile.release] panic = 'abort' diff --git a/python/rustjswasm/pyproject.toml.jinja b/python/rustjswasm/pyproject.toml.jinja index dc191a5..3d5e06f 100644 --- a/python/rustjswasm/pyproject.toml.jinja +++ b/python/rustjswasm/pyproject.toml.jinja @@ -172,6 +172,7 @@ targets = [ ] [tool.hatch.build.hooks.hatch-rs] +env = { PYO3_BUILD_EXTENSION_MODULE = "1" } verbose = true abi3 = true module = "{{ module }}"