Ravenports generated: 24 Feb 2024 23:39
[ravenports.git] / bucket_A5 / python-setuptools-rust
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-setuptools-rust
4 VERSION=                1.9.0
5 KEYWORDS=               python
6 VARIANTS=               v11 v12
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]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPIWHL/f7/7f/8b1c33598b03ad612b8ced223f9ca54076b789fabf5a66ce37cc096d9cf7
14 DISTFILE[1]=            setuptools_rust-1.9.0-py3-none-any.whl:main
15 DF_INDEX=               1
16 SPKGS[v11]=             single
17 SPKGS[v12]=             single
18
19 OPTIONS_AVAILABLE=      PY311 PY312
20 OPTIONS_STANDARD=       none
21 VOPTS[v11]=             PY311=ON PY312=OFF
22 VOPTS[v12]=             PY311=OFF PY312=ON
23
24 DISTNAME=               setuptools_rust-1.9.0.dist-info
25
26 GENERATED=              yes
27
28 [PY311].RUN_DEPENDS_ON=                 python-setuptools:single:v11
29                                         python-semantic-version:single:v11
30 [PY311].USES_ON=                        python:v11,wheel
31
32 [PY312].RUN_DEPENDS_ON=                 python-setuptools:single:v12
33                                         python-semantic-version:single:v12
34 [PY312].USES_ON=                        python:v12,wheel
35
36 [FILE:2781:descriptions/desc.single]
37 # Setuptools plugin for Rust extensions
38
39 [github actions]
40 [pypi package]
41 [readthedocs]
42 [Ruff]
43
44 `setuptools-rust` is a plugin for `setuptools` to build Rust Python
45 extensions implemented with [PyO3] or [rust-cpython].
46
47 Compile and distribute Python extensions written in Rust as easily as if
48 they were written in C.
49
50 ## Quickstart
51
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
55 want
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
60 modules in Rust.
61
62 ```
63 hello-world
64 ├── python
65 │   └── hello_world
66 │       └── __init__.py
67 └── rust
68     └── lib.rs
69 ```
70
71 Once the implementation files are in place, we need to add a
72 `pyproject.toml`
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:
78
79 ```toml
80 # pyproject.toml
81 [build-system]
82 requires = ["setuptools", "setuptools-rust"]
83 build-backend = "setuptools.build_meta"
84
85 [project]
86 name = "hello-world"
87 version = "1.0"
88
89 [tool.setuptools.packages]
90 # Pure Python packages/modules
91 find = { where = ["python"] }
92
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
98 of a Python package.
99 path = "Cargo.toml"      # Default value, can be omitted
100 binding = "PyO3"         # Default value, can be omitted
101 ```
102
103 Each extension module should map directly into the corresponding `[lib]`
104 table on the
105 [Cargo manifest file]:
106
107 ```toml
108 # Cargo.toml
109 [package]
110 name = "hello-world"
111 version = "0.1.0"
112 edition = "2021"
113
114 [dependencies]
115 pyo3 = "0.20.3"
116
117 [lib]
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
121 path = "rust/lib.rs"
122 crate-type = ["cdylib"]  # required for shared library for Python to import
123 from.
124
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
128 ```
129
130 You will also need to tell Setuptools that the Rust files are required to
131 build your
132 project from the [source distribution].
133 That can be done either via `MANIFEST.in` (see example below) or via a
134 plugin like
135 [`setuptools-scm`].
136
137
138
139 [FILE:117:distinfo]
140 409caf49dcf7ad9bd510b4bf4011fbad504e745fae98f57fe1c06f3a97719638        26608 setuptools_rust-1.9.0-py3-none-any.whl
141