Skip to content

Commit

Permalink
🔧 build(Python): Mixed rust/python
Browse files Browse the repository at this point in the history
Allow mixed rust/python project
  • Loading branch information
wychlw committed Sep 6, 2024
1 parent 14d2bb3 commit 32ffbeb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]
dynamic = ["version"]

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

__doc__ = tester.__doc__
if hasattr(tester, "__all__"):
__all__ = tester.__all__
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use pyo3::prelude::*;
use pythonapi::{pyshell::PyShell, shell_like::PyTty};

#[pymodule]
#[pyo3(name = "tester")]
fn tester(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::<PyTty>()?;
m.add_class::<PyShell>()?;
Expand Down

0 comments on commit 32ffbeb

Please sign in to comment.