-
Notifications
You must be signed in to change notification settings - Fork 958
Expand file tree
/
Copy pathCargo.toml
More file actions
224 lines (193 loc) · 7.18 KB
/
Cargo.toml
File metadata and controls
224 lines (193 loc) · 7.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
[package]
name = "pyo3"
version = "0.28.3"
description = "Bindings to Python interpreter"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
readme = "README.md"
keywords = ["pyo3", "python", "cpython", "ffi"]
homepage = "https://github.com/pyo3/pyo3"
repository = "https://github.com/pyo3/pyo3"
documentation = "https://docs.rs/crate/pyo3/"
categories = ["api-bindings", "development-tools::ffi"]
license = "MIT OR Apache-2.0"
exclude = [
"/.gitignore",
".cargo/config",
"/codecov.yml",
"/Makefile",
"/pyproject.toml",
"/noxfile.py",
"/.github",
"/tests/test_compile_error.rs",
"/tests/ui",
]
edition = "2021"
rust-version.workspace = true
[dependencies]
libc = "0.2.62"
once_cell = "1.21"
# ffi bindings to the python interpreter, split into a separate crate so they can be used independently
pyo3-ffi = { path = "pyo3-ffi", version = "=0.28.3" }
# support crate for macros feature
pyo3-macros = { path = "pyo3-macros", version = "=0.28.3", optional = true }
# support crate for multiple-pymethods feature
inventory = { version = "0.3.5", optional = true }
# crate integrations that can be added using the eponymous features
anyhow = { version = "1.0.1", optional = true }
bigdecimal = { version = "0.4.7", optional = true }
bytes = { version = "1.10", optional = true }
chrono = { version = "0.4.25", default-features = false, optional = true }
chrono-tz = { version = ">= 0.10, < 0.11", default-features = false, optional = true }
either = { version = "1.9", optional = true }
eyre = { version = ">= 0.6.8, < 0.7", optional = true }
hashbrown = { version = ">= 0.15.0, < 0.17", optional = true, default-features = false }
indexmap = { version = ">= 2.5.0, < 3", optional = true }
jiff-02 = { package = "jiff", version = "0.2", optional = true }
num-bigint = { version = "0.4.4", optional = true }
num-complex = { version = ">= 0.4.6, < 0.5", optional = true }
num-rational = { version = "0.4.1", optional = true }
num-traits = { version = "0.2.16", optional = true }
ordered-float = { version = "5.0.0", default-features = false, optional = true }
rust_decimal = { version = "1.15", default-features = false, optional = true }
time = { version = "0.3.38", default-features = false, optional = true }
serde = { version = "1.0", optional = true }
smallvec = { version = "1.0", optional = true }
uuid = { version = "1.12.0", optional = true }
lock_api = { version = "0.4", optional = true }
parking_lot = { version = "0.12", optional = true }
iana-time-zone = { version = "0.1", optional = true, features = ["fallback"]}
[target.'cfg(not(target_has_atomic = "64"))'.dependencies]
portable-atomic = "1.0"
[dev-dependencies]
assert_approx_eq = "1.1.0"
chrono = "0.4.25"
chrono-tz = ">= 0.10, < 0.11"
trybuild = ">=1.0.115"
proptest = { version = "1.0", default-features = false, features = ["std"] }
send_wrapper = "0.6"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.61"
rayon = "1.6.1"
futures = "0.3.28"
tempfile = "3.12.0"
static_assertions = "1.1.0"
uuid = { version = "1.10.0", features = ["v4"] }
parking_lot = { version = "0.12.3", features = ["arc_lock"] }
[build-dependencies]
pyo3-build-config = { path = "pyo3-build-config", version = "=0.28.3", features = ["resolve-config"] }
[features]
default = ["macros"]
# Enables support for `async fn` for `#[pyfunction]` and `#[pymethods]`.
experimental-async = ["macros", "pyo3-macros/experimental-async"]
# Enables pyo3::inspect module and additional type information on FromPyObject
# and IntoPy traits
experimental-inspect = ["pyo3-macros/experimental-inspect"]
# Enables macros: #[pyclass], #[pymodule], #[pyfunction] etc.
macros = ["pyo3-macros"]
# Enables multiple #[pymethods] per #[pyclass]
multiple-pymethods = ["inventory", "pyo3-macros/multiple-pymethods"]
# Deprecated: use the `PYO3_BUILD_EXTENSION_MODULE` environment variable when
# building a Python extension module (set automatically by `setuptools-rust` and
# `maturin`).
extension-module = ["pyo3-ffi/extension-module"]
# Use the Python limited API. See https://www.python.org/dev/peps/pep-0384/ for more.
abi3 = ["pyo3-build-config/abi3", "pyo3-ffi/abi3"]
# With abi3, we can manually set the minimum Python version.
abi3-py38 = ["abi3-py39", "pyo3-build-config/abi3-py38", "pyo3-ffi/abi3-py38"]
abi3-py39 = ["abi3-py310", "pyo3-build-config/abi3-py39", "pyo3-ffi/abi3-py39"]
abi3-py310 = ["abi3-py311", "pyo3-build-config/abi3-py310", "pyo3-ffi/abi3-py310"]
abi3-py311 = ["abi3-py312", "pyo3-build-config/abi3-py311", "pyo3-ffi/abi3-py311"]
abi3-py312 = ["abi3-py313", "pyo3-build-config/abi3-py312", "pyo3-ffi/abi3-py312"]
abi3-py313 = ["abi3-py314", "pyo3-build-config/abi3-py313", "pyo3-ffi/abi3-py313"]
abi3-py314 = ["abi3", "pyo3-build-config/abi3-py314", "pyo3-ffi/abi3-py314"]
# deprecated: no longer needed, raw-dylib is used instead
generate-import-lib = ["pyo3-ffi/generate-import-lib"]
# Changes `Python::attach` to automatically initialize the Python interpreter if needed.
auto-initialize = []
# Enables `Clone`ing references to Python objects `Py<T>` which panics if the
# thread is not attached to the Python interpreter.
py-clone = []
# Adds `OnceExt` and `MutexExt` implementations to the `parking_lot` types
parking_lot = ["dep:parking_lot", "lock_api"]
arc_lock = ["lock_api", "lock_api/arc_lock", "parking_lot?/arc_lock"]
num-bigint = ["dep:num-bigint", "dep:num-traits"]
bigdecimal = ["dep:bigdecimal", "num-bigint"]
chrono-local = ["chrono/clock", "dep:iana-time-zone"]
# Optimizes PyObject to Vec conversion and so on.
nightly = []
# Activates all additional features
# This is mostly intended for testing purposes - activating *all* of these isn't particularly useful.
full = [
"macros",
# "multiple-pymethods", # Not supported by wasm
"anyhow",
"arc_lock",
"bigdecimal",
"bytes",
"chrono",
"chrono-local",
"chrono-tz",
"either",
"experimental-async",
"experimental-inspect",
"eyre",
"hashbrown",
"indexmap",
"jiff-02",
"lock_api",
"num-bigint",
"num-complex",
"num-rational",
"ordered-float",
"parking_lot",
"py-clone",
"rust_decimal",
"serde",
"smallvec",
"time",
"uuid",
]
[workspace]
members = [
"pyo3-ffi",
"pyo3-build-config",
"pyo3-macros",
"pyo3-macros-backend",
"pyo3-introspection",
"pytests",
"examples",
]
package.rust-version = "1.83"
[package.metadata.docs.rs]
no-default-features = true
features = ["full"]
rustdoc-args = ["--cfg", "docsrs"]
[workspace.lints.clippy]
checked_conversions = "warn"
dbg_macro = "warn"
explicit_into_iter_loop = "warn"
explicit_iter_loop = "warn"
filter_map_next = "warn"
flat_map_option = "warn"
let_unit_value = "warn"
manual_assert = "warn"
manual_ok_or = "warn"
todo = "warn"
# TODO: make this "warn"
# https://github.com/PyO3/pyo3/issues/5487
undocumented_unsafe_blocks = "allow"
unnecessary_wraps = "warn"
useless_transmute = "warn"
used_underscore_binding = "warn"
[workspace.lints.rust]
elided_lifetimes_in_paths = "warn"
invalid_doc_attributes = "warn"
rust_2018_idioms = { level = "warn", priority = -1 }
rust_2021_prelude_collisions = "warn"
unused_lifetimes = "warn"
unsafe_op_in_unsafe_fn = "warn"
[workspace.lints.rustdoc]
broken_intra_doc_links = "warn"
bare_urls = "warn"
[lints]
workspace = true