mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Touchup the extension module guide (#9293)
Co-authored-by: pantheraleo-7 <159872817+pantheraleo-7@users.noreply.github.com>
This commit is contained in:
parent
de2e9cd0ff
commit
d391961fa5
1 changed files with 7 additions and 4 deletions
|
@ -219,15 +219,14 @@ Most Python projects are "pure Python", meaning they do not define modules in ot
|
|||
C, C++, FORTRAN, or Rust. However, projects with extension modules are often used for performance
|
||||
sensitive code.
|
||||
|
||||
Creating a project with an extension module requires an choosing an alternative build backend. uv
|
||||
supports creating projects with the following build backends that support building extension
|
||||
modules:
|
||||
Creating a project with an extension module requires choosing an alternative build system. uv
|
||||
supports creating projects with the following build systems that support building extension modules:
|
||||
|
||||
- [`maturin`](https://www.maturin.rs) for projects with Rust
|
||||
- [`scikit-build`](https://scikit-build.readthedocs.io/en/latest/) for projects with C, C++,
|
||||
FORTRAN, Cython
|
||||
|
||||
Using `maturin` is recommended for combining Rust and Python:
|
||||
Specify the build system with the `--build-backend` flag:
|
||||
|
||||
```console
|
||||
$ uv init --build-backend maturin example-ext
|
||||
|
@ -254,6 +253,10 @@ example-ext
|
|||
└── _core.pyi
|
||||
```
|
||||
|
||||
!!! note
|
||||
|
||||
If using `scikit-build`, you'll see CMake configuration and a `main.cpp` file instead.
|
||||
|
||||
The Rust library defines a simple function:
|
||||
|
||||
```rust title="src/lib.rs"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue