1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-setuptools-rust
7 SDESC[v11]= Setuptools Rust extension plugin (3.11)
8 SDESC[v12]= Setuptools Rust extension plugin (3.12)
9 HOMEPAGE= https://github.com/PyO3/setuptools-rust
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPIWHL/f7/7f/8b1c33598b03ad612b8ced223f9ca54076b789fabf5a66ce37cc096d9cf7
14 DISTFILE[1]= setuptools_rust-1.9.0-py3-none-any.whl:main
19 OPTIONS_AVAILABLE= PY311 PY312
20 OPTIONS_STANDARD= none
21 VOPTS[v11]= PY311=ON PY312=OFF
22 VOPTS[v12]= PY311=OFF PY312=ON
24 DISTNAME= setuptools_rust-1.9.0.dist-info
28 [PY311].RUN_DEPENDS_ON= python-setuptools:single:v11
29 python-semantic-version:single:v11
30 [PY311].USES_ON= python:v11,wheel
32 [PY312].RUN_DEPENDS_ON= python-setuptools:single:v12
33 python-semantic-version:single:v12
34 [PY312].USES_ON= python:v12,wheel
36 [FILE:2781:descriptions/desc.single]
37 # Setuptools plugin for Rust extensions
44 `setuptools-rust` is a plugin for `setuptools` to build Rust Python
45 extensions implemented with [PyO3] or [rust-cpython].
47 Compile and distribute Python extensions written in Rust as easily as if
48 they were written in C.
52 The following is a very basic tutorial that shows how to use
53 `setuptools-rust` in `pyproject.toml`.
54 It assumes that you already have a bunch of Python and Rust files that you
56 to distribute. You can see examples for these files in the
57 [`examples/hello-world`]
58 directory in the [github repository].
59 The [PyO3 docs] have detailed information on how to write Python
71 Once the implementation files are in place, we need to add a
73 file that tells anyone that wants to use your project how to build it.
74 In this file, we use an [array of tables]
75 (TOML jargon equivalent to Python's list of dicts) for
76 ``[[tool.setuptools-rust.ext-modules]]``,
77 to specify different extension modules written in Rust:
82 requires = ["setuptools", "setuptools-rust"]
83 build-backend = "setuptools.build_meta"
89 [tool.setuptools.packages]
90 # Pure Python packages/modules
91 find = { where = ["python"] }
93 [[tool.setuptools-rust.ext-modules]]
94 # Private Rust extension module to be nested into the Python package
95 target = "hello_world._lib" # The last part of the name (e.g. "_lib") has
96 to match lib.name in Cargo.toml,
97 # but you can add a prefix to nest it inside
99 path = "Cargo.toml" # Default value, can be omitted
100 binding = "PyO3" # Default value, can be omitted
103 Each extension module should map directly into the corresponding `[lib]`
105 [Cargo manifest file]:
118 name = "_lib" # private module to be nested into Python package,
119 # needs to match the name of the function with the
120 `[#pymodule]` attribute
122 crate-type = ["cdylib"] # required for shared library for Python to import
125 # See more keys and their definitions at
126 https://doc.rust-lang.org/cargo/reference/manifest.html
127 # See also PyO3 docs on writing Cargo.toml files at https://pyo3.rs
130 You will also need to tell Setuptools that the Rust files are required to
132 project from the [source distribution].
133 That can be done either via `MANIFEST.in` (see example below) or via a
140 409caf49dcf7ad9bd510b4bf4011fbad504e745fae98f57fe1c06f3a97719638 26608 setuptools_rust-1.9.0-py3-none-any.whl