Skip to content

Commit

Permalink
Recommend setting package.metadata.maturin.python-source
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Jun 16, 2022
1 parent 85c0804 commit 1a763a7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ my-project
   └── lib.rs
```

> **Note**
> This structure is recommended to avoid [a common `ImportError` pitfall](https://github.com/PyO3/maturin/issues/490)
maturin will add the native extension as a module in your python folder. When using develop, maturin will copy the native library and for cffi also the glue code to your python folder. You should add those files to your gitignore.

With cffi you can do `from .my_project import lib` and then use `lib.my_native_function`, with pyo3/rust-cpython you can directly `from .my_project import my_native_function`.
Expand Down

0 comments on commit 1a763a7

Please sign in to comment.