Skip to content

Commit

Permalink
feat(bindings/python): convert to mixed Python/Rust project layout
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Mar 22, 2023
1 parent cc8e489 commit b5bb4d2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ version = "0.30.3"
[lib]
crate-type = ["cdylib"]
doc = false
name = "opendal"
name = "_opendal"

[dependencies]
chrono = { version = "0.4.24", default-features = false, features = ["std"] }
Expand All @@ -37,3 +37,6 @@ opendal = { version = "0.30", path = "../../core" }
pyo3 = { version = "0.18", features = ["chrono"] }
pyo3-asyncio = { version = "0.18", features = ["tokio-runtime"] }
tokio = "1"

[package.metadata.maturin]
name = "opendal._opendal"
1 change: 1 addition & 0 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ Repository = "https://github.com/apache/incubator-opendal"

[tool.maturin]
features = ["pyo3/extension-module"]
python-source = "python"
6 changes: 6 additions & 0 deletions bindings/python/python/opendal/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from ._opendal import *


__doc__ = _opendal.__doc__
__all__ = _opendal.__all__

File renamed without changes.
2 changes: 1 addition & 1 deletion bindings/python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ fn format_pyerr(err: od::Error) -> PyErr {
/// asyncio.run(main())
/// ```
#[pymodule]
fn opendal(py: Python, m: &PyModule) -> PyResult<()> {
fn _opendal(py: Python, m: &PyModule) -> PyResult<()> {
m.add_class::<Operator>()?;
m.add_class::<Reader>()?;
m.add_class::<AsyncOperator>()?;
Expand Down

0 comments on commit b5bb4d2

Please sign in to comment.