From ed3a4d7ac662445aa2e7d5d32336d72cff033d19 Mon Sep 17 00:00:00 2001 From: Grieve Date: Fri, 29 Nov 2024 15:41:16 +0800 Subject: [PATCH] chore: adjust pyo3 setting --- wren-core-py/Cargo.lock | 10 ---------- wren-core-py/Cargo.toml | 9 +++++---- wren-core-py/justfile | 4 ++-- wren-core-py/pyproject.toml | 1 + 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/wren-core-py/Cargo.lock b/wren-core-py/Cargo.lock index 5fc11d3a7..962c2c12f 100644 --- a/wren-core-py/Cargo.lock +++ b/wren-core-py/Cargo.lock @@ -2185,7 +2185,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3015cf985888fe66cfb63ce0e321c603706cd541b7aec7ddd35c281390af45d8" dependencies = [ "once_cell", - "python3-dll-a", "target-lexicon", ] @@ -2224,15 +2223,6 @@ dependencies = [ "syn", ] -[[package]] -name = "python3-dll-a" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd0b78171a90d808b319acfad166c4790d9e9759bbc14ac8273fe133673dd41b" -dependencies = [ - "cc", -] - [[package]] name = "quote" version = "1.0.37" diff --git a/wren-core-py/Cargo.toml b/wren-core-py/Cargo.toml index 3abe94dee..1e77fc2fa 100644 --- a/wren-core-py/Cargo.toml +++ b/wren-core-py/Cargo.toml @@ -9,10 +9,7 @@ name = "wren_core_py" crate-type = ["cdylib"] [dependencies] -pyo3 = { version = "0.23.2", features = [ - "extension-module", - "generate-import-lib", -] } +pyo3 = { version = "0.23.2", features = ["extension-module"] } wren-core = { path = "../wren-core/core" } base64 = "0.22.1" serde_json = "1.0.117" @@ -25,3 +22,7 @@ tokio = "1.40.0" [build-dependencies] pyo3-build-config = "0.23.2" + +[features] +extension-module = ["pyo3/extension-module"] +default = ["extension-module"] diff --git a/wren-core-py/justfile b/wren-core-py/justfile index d10453b40..509cc05bd 100644 --- a/wren-core-py/justfile +++ b/wren-core-py/justfile @@ -5,11 +5,11 @@ install: poetry install --no-root build *args: - poetry run maturin build {{args}} + poetry run maturin build {{ args }} develop: poetry run maturin develop test: develop - cargo test + cargo test --no-default-features poetry run pytest diff --git a/wren-core-py/pyproject.toml b/wren-core-py/pyproject.toml index 2f097d7f8..c8efa218b 100644 --- a/wren-core-py/pyproject.toml +++ b/wren-core-py/pyproject.toml @@ -20,6 +20,7 @@ module-name = "wren_core" include = [{ path = "Cargo.lock", format = "sdist" }] exclude = ["tests/**", "target/**"] locked = true +features = ["pyo3/extension-module"] [build-system] requires = ["maturin>=1.0,<2.0"]