Browse Source

init `dora-node-api-python`

tags/v0.0.0-test.4
haixuanTao 3 years ago
parent
commit
f7d288ba69
4 changed files with 34 additions and 1 deletions
  1. +8
    -1
      Cargo.lock
  2. +1
    -0
      Cargo.toml
  3. +10
    -0
      apis/python/node/Cargo.toml
  4. +15
    -0
      apis/python/node/src/lib.rs

+ 8
- 1
Cargo.lock View File

@@ -696,6 +696,14 @@ dependencies = [
"zenoh-config",
]

[[package]]
name = "dora-node-api-python"
version = "0.1.0"
dependencies = [
"dora-node-api",
"pyo3",
]

[[package]]
name = "dora-operator-api"
version = "0.1.0"
@@ -748,7 +756,6 @@ version = "0.1.0"
dependencies = [
"opentelemetry",
"opentelemetry-jaeger",
"tokio",
]

[[package]]


+ 1
- 0
Cargo.toml View File

@@ -4,6 +4,7 @@ members = [
"apis/rust/operator",
"apis/rust/operator/macros",
"apis/python/binding",
"apis/python/node",
"binaries/coordinator",
"binaries/runtime",
"libraries/extensions/message",


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

@@ -0,0 +1,10 @@
[package]
name = "dora-node-api-python"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
dora-node-api = { path = "../../rust/node" }
pyo3 = "0.16"

+ 15
- 0
apis/python/node/src/lib.rs View File

@@ -0,0 +1,15 @@
use dora_node_api::DoraNode;
use pyo3::prelude::*;

#[pyclass]
#[repr(transparent)]
pub struct PyDoraNode {
pub node: DoraNode,
}

/// This module is implemented in Rust.
#[pymodule]
fn wonnx(_py: Python, m: &PyModule) -> PyResult<()> {
m.add_class::<PyDoraNode>().unwrap();
Ok(())
}

Loading…
Cancel
Save