Browse Source

use `pyproject.toml` for activating `pyo3/extension-module`

Since the merge of https://github.com/PyO3/maturin/pull/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.
tags/v0.0.0-test.4
haixuanTao 3 years ago
parent
commit
4158b1b0de
3 changed files with 11 additions and 9 deletions
  1. +2
    -4
      .github/workflows/ci.yml
  2. +0
    -5
      apis/python/node/Cargo.toml
  3. +9
    -0
      apis/python/node/pyproject.toml

+ 2
- 4
.github/workflows/ci.yml View File

@@ -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"


+ 0
- 5
apis/python/node/Cargo.toml View File

@@ -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
- 0
apis/python/node/pyproject.toml View File

@@ -0,0 +1,9 @@
[build-system]
requires = ["maturin>=0.12,<0.13"]
build-backend = "maturin"

[project]
name = "dora"

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

Loading…
Cancel
Save