1 | [package] |
2 | name = "pyo3" |
3 | version = "0.20.3" |
4 | description = "Bindings to Python interpreter" |
5 | authors = ["PyO3 Project and Contributors <https://github.com/PyO3>" ] |
6 | readme = "README.md" |
7 | keywords = ["pyo3" , "python" , "cpython" , "ffi" ] |
8 | homepage = "https://github.com/pyo3/pyo3" |
9 | repository = "https://github.com/pyo3/pyo3" |
10 | documentation = "https://docs.rs/crate/pyo3/" |
11 | categories = ["api-bindings" , "development-tools::ffi" ] |
12 | license = "MIT OR Apache-2.0" |
13 | exclude = ["/.gitignore" , ".cargo/config" , "/codecov.yml" , "/Makefile" , "/pyproject.toml" , "/noxfile.py" , "/.github" , "/tests/test_compile_error.rs" , "/tests/ui" ] |
14 | edition = "2021" |
15 | rust-version = "1.56" |
16 | |
17 | [dependencies] |
18 | cfg-if = "1.0" |
19 | libc = "0.2.62" |
20 | parking_lot = ">= 0.11, < 0.13" |
21 | memoffset = "0.9" |
22 | portable-atomic = "1.0" |
23 | |
24 | # ffi bindings to the python interpreter, split into a separate crate so they can be used independently |
25 | pyo3-ffi = { path = "pyo3-ffi" , version = "=0.20.3" } |
26 | |
27 | # support crates for macros feature |
28 | pyo3-macros = { path = "pyo3-macros" , version = "=0.20.3" , optional = true } |
29 | indoc = { version = "2.0.1" , optional = true } |
30 | unindent = { version = "0.2.1" , optional = true } |
31 | |
32 | # support crate for multiple-pymethods feature |
33 | inventory = { version = "0.3.0" , optional = true } |
34 | |
35 | # crate integrations that can be added using the eponymous features |
36 | anyhow = { version = "1.0" , optional = true } |
37 | chrono = { version = "0.4.25" , default-features = false, optional = true } |
38 | either = { version = "1.9" , optional = true } |
39 | eyre = { version = ">= 0.4, < 0.7" , optional = true } |
40 | hashbrown = { version = ">= 0.9, < 0.15" , optional = true } |
41 | indexmap = { version = ">= 1.6, < 3" , optional = true } |
42 | num-bigint = { version = "0.4" , optional = true } |
43 | num-complex = { version = ">= 0.2, < 0.5" , optional = true } |
44 | rust_decimal = { version = "1.0.0" , default-features = false, optional = true } |
45 | serde = { version = "1.0" , optional = true } |
46 | smallvec = { version = "1.0" , optional = true } |
47 | |
48 | [dev-dependencies] |
49 | assert_approx_eq = "1.1.0" |
50 | chrono = { version = "0.4.25" } |
51 | # Required for "and $N others" normalization |
52 | trybuild = ">=1.0.70" |
53 | proptest = { version = "1.0" , default-features = false, features = ["std" ] } |
54 | send_wrapper = "0.6" |
55 | serde = { version = "1.0" , features = ["derive" ] } |
56 | serde_json = "1.0.61" |
57 | rayon = "1.6.1" |
58 | widestring = "0.5.1" |
59 | |
60 | [build-dependencies] |
61 | pyo3-build-config = { path = "pyo3-build-config" , version = "=0.20.3" , features = ["resolve-config" ] } |
62 | |
63 | [features] |
64 | default = ["macros" ] |
65 | |
66 | # Enables pyo3::inspect module and additional type information on FromPyObject |
67 | # and IntoPy traits |
68 | experimental-inspect = [] |
69 | |
70 | # Enables macros: #[pyclass], #[pymodule], #[pyfunction] etc. |
71 | macros = ["pyo3-macros" , "indoc" , "unindent" ] |
72 | |
73 | # Enables multiple #[pymethods] per #[pyclass] |
74 | multiple-pymethods = ["inventory" , "pyo3-macros/multiple-pymethods" ] |
75 | |
76 | # Use this feature when building an extension module. |
77 | # It tells the linker to keep the python symbols unresolved, |
78 | # so that the module can also be used with statically linked python interpreters. |
79 | extension-module = ["pyo3-ffi/extension-module" ] |
80 | |
81 | # Use the Python limited API. See https://www.python.org/dev/peps/pep-0384/ for more. |
82 | abi3 = ["pyo3-build-config/abi3" , "pyo3-ffi/abi3" ] |
83 | |
84 | # With abi3, we can manually set the minimum Python version. |
85 | abi3-py37 = ["abi3-py38" , "pyo3-build-config/abi3-py37" , "pyo3-ffi/abi3-py37" ] |
86 | abi3-py38 = ["abi3-py39" , "pyo3-build-config/abi3-py38" , "pyo3-ffi/abi3-py38" ] |
87 | abi3-py39 = ["abi3-py310" , "pyo3-build-config/abi3-py39" , "pyo3-ffi/abi3-py39" ] |
88 | abi3-py310 = ["abi3-py311" , "pyo3-build-config/abi3-py310" , "pyo3-ffi/abi3-py310" ] |
89 | abi3-py311 = ["abi3-py312" , "pyo3-build-config/abi3-py311" , "pyo3-ffi/abi3-py311" ] |
90 | abi3-py312 = ["abi3" , "pyo3-build-config/abi3-py312" , "pyo3-ffi/abi3-py312" ] |
91 | |
92 | # Automatically generates `python3.dll` import libraries for Windows targets. |
93 | generate-import-lib = ["pyo3-ffi/generate-import-lib" ] |
94 | |
95 | # Changes `Python::with_gil` to automatically initialize the Python interpreter if needed. |
96 | auto-initialize = [] |
97 | |
98 | # Optimizes PyObject to Vec conversion and so on. |
99 | nightly = [] |
100 | |
101 | # Activates all additional features |
102 | # This is mostly intended for testing purposes - activating *all* of these isn't particularly useful. |
103 | full = [ |
104 | "macros" , |
105 | # "multiple-pymethods", # TODO re-add this when MSRV is greater than 1.62 |
106 | "anyhow" , |
107 | "chrono" , |
108 | "either" , |
109 | "experimental-inspect" , |
110 | "eyre" , |
111 | "hashbrown" , |
112 | "indexmap" , |
113 | "num-bigint" , |
114 | "num-complex" , |
115 | "rust_decimal" , |
116 | "serde" , |
117 | "smallvec" , |
118 | ] |
119 | |
120 | [workspace] |
121 | members = [ |
122 | "pyo3-ffi" , |
123 | "pyo3-build-config" , |
124 | "pyo3-macros" , |
125 | "pyo3-macros-backend" , |
126 | "pytests" , |
127 | "examples" , |
128 | ] |
129 | |
130 | [package.metadata.docs.rs] |
131 | no-default-features = true |
132 | features = ["full" ] |
133 | rustdoc-args = ["--cfg" , "docsrs" ] |
134 | |
135 | [workspace.lints.clippy] |
136 | checked_conversions = "warn" |
137 | dbg_macro = "warn" |
138 | explicit_into_iter_loop = "warn" |
139 | explicit_iter_loop = "warn" |
140 | filter_map_next = "warn" |
141 | flat_map_option = "warn" |
142 | let_unit_value = "warn" |
143 | manual_assert = "warn" |
144 | manual_ok_or = "warn" |
145 | todo = "warn" |
146 | unnecessary_wraps = "warn" |
147 | useless_transmute = "warn" |
148 | used_underscore_binding = "warn" |
149 | |
150 | [workspace.lints.rust] |
151 | elided_lifetimes_in_paths = "warn" |
152 | invalid_doc_attributes = "warn" |
153 | rust_2018_idioms = "warn" |
154 | rust_2021_prelude_collisions = "warn" |
155 | unused_lifetimes = "warn" |
156 | # rust nightly got stricter about these since PyO3 0.20 was released |
157 | dead_code = "allow" |
158 | unused_imports = "allow" |
159 | |
160 | [workspace.lints.rustdoc] |
161 | broken_intra_doc_links = "warn" |
162 | bare_urls = "warn" |
163 | |
164 | [lints] |
165 | workspace = true |
166 | |