From d60d77d3ccd2955bd14eb3d28b8e251c5d0aeb39 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 20 Nov 2024 16:02:23 -0600 Subject: [PATCH 1/2] Touchup the extension module guide --- docs/concepts/projects/init.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/concepts/projects/init.md b/docs/concepts/projects/init.md index bc24e47c5b51b..56c3fdb8a313f 100644 --- a/docs/concepts/projects/init.md +++ b/docs/concepts/projects/init.md @@ -219,15 +219,15 @@ 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 +Creating a project with an extension module requires an 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 +254,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" From 2f674428d06771126b396b33366bc2aa39d9a111 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Thu, 21 Nov 2024 08:23:05 -0600 Subject: [PATCH 2/2] fixup Co-authored-by: pantheraleo-7 <159872817+pantheraleo-7@users.noreply.github.com> --- docs/concepts/projects/init.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/concepts/projects/init.md b/docs/concepts/projects/init.md index 56c3fdb8a313f..2a6ba9860a335 100644 --- a/docs/concepts/projects/init.md +++ b/docs/concepts/projects/init.md @@ -219,9 +219,8 @@ 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 system. uv -supports creating projects with the following build systems 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++,