Skip to content

Commit

Permalink
use pyproject.toml for activating pyo3/extension-module
Browse files Browse the repository at this point in the history
Since the merge of PyO3/maturin#605 ,
we can add features flag when maturin build the python project, removing
the need to always enabling `extension-module` flag when building.

The `extension-module` flag creates crash when building and testing outside
of maturin.

Previous fix required to disable default feature flag when building and testing which is not ideal.
  • Loading branch information
haixuanTao committed Aug 5, 2022
1 parent 4ff9a59 commit 4158b1b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ jobs:
- name: "Check"
run: cargo check --all
- name: "Build"
# Has to use `--no-default-features` to avoid crash.
# See: https://pyo3.rs/latest/faq.html#i-cant-run-cargo-test-im-having-linker-issues-like-symbol-not-found-or-undefined-reference-to-_pyexc_systemerror
run: cargo build --all --no-default-features
run: cargo build --all
- name: "Test"
run: cargo test --all --no-default-features
run: cargo test --all

clippy:
name: "Clippy"
Expand Down
5 changes: 0 additions & 5 deletions apis/python/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,3 @@ serde_yaml = "0.8.23"
[lib]
name = "dora"
crate-type = ["cdylib"]


[features]
extension-module = ["pyo3/extension-module"]
default = ["extension-module"]
9 changes: 9 additions & 0 deletions apis/python/node/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build-system]
requires = ["maturin>=0.12,<0.13"]
build-backend = "maturin"

[project]
name = "dora"

[tool.maturin]
features = ["pyo3/extension-module"]

0 comments on commit 4158b1b

Please sign in to comment.