| 1 | [package] |
| 2 | name = "pyo3" |
| 3 | version = "0.24.2" |
| 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.63" |
| 16 | |
| 17 | [dependencies] |
| 18 | cfg-if = "1.0" |
| 19 | libc = "0.2.62" |
| 20 | memoffset = "0.9" |
| 21 | once_cell = "1.13" |
| 22 | |
| 23 | # ffi bindings to the python interpreter, split into a separate crate so they can be used independently |
| 24 | pyo3-ffi = { path = "pyo3-ffi" , version = "=0.24.2" } |
| 25 | |
| 26 | # support crates for macros feature |
| 27 | pyo3-macros = { path = "pyo3-macros" , version = "=0.24.2" , optional = true } |
| 28 | indoc = { version = "2.0.1" , optional = true } |
| 29 | unindent = { version = "0.2.1" , optional = true } |
| 30 | |
| 31 | # support crate for multiple-pymethods feature |
| 32 | inventory = { version = "0.3.5" , optional = true } |
| 33 | |
| 34 | # crate integrations that can be added using the eponymous features |
| 35 | anyhow = { version = "1.0.1" , optional = true } |
| 36 | chrono = { version = "0.4.25" , default-features = false, optional = true } |
| 37 | chrono-tz = { version = ">= 0.10, < 0.11" , default-features = false, optional = true } |
| 38 | either = { version = "1.9" , optional = true } |
| 39 | eyre = { version = ">= 0.6.8, < 0.7" , optional = true } |
| 40 | hashbrown = { version = ">= 0.14.5, < 0.16" , optional = true } |
| 41 | indexmap = { version = ">= 2.5.0, < 3" , optional = true } |
| 42 | jiff-02 = { package = "jiff" , version = "0.2" , optional = true } |
| 43 | num-bigint = { version = "0.4.2" , optional = true } |
| 44 | num-complex = { version = ">= 0.4.6, < 0.5" , optional = true } |
| 45 | num-rational = { version = "0.4.1" , optional = true } |
| 46 | rust_decimal = { version = "1.15" , default-features = false, optional = true } |
| 47 | serde = { version = "1.0" , optional = true } |
| 48 | smallvec = { version = "1.0" , optional = true } |
| 49 | uuid = { version = "1.11.0" , optional = true } |
| 50 | |
| 51 | [target.'cfg(not(target_has_atomic = "64"))'.dependencies] |
| 52 | portable-atomic = "1.0" |
| 53 | |
| 54 | [dev-dependencies] |
| 55 | assert_approx_eq = "1.1.0" |
| 56 | chrono = "0.4.25" |
| 57 | chrono-tz = ">= 0.10, < 0.11" |
| 58 | # Required for "and $N others" normalization |
| 59 | trybuild = ">=1.0.70" |
| 60 | proptest = { version = "1.0" , default-features = false, features = ["std" ] } |
| 61 | send_wrapper = "0.6" |
| 62 | serde = { version = "1.0" , features = ["derive" ] } |
| 63 | serde_json = "1.0.61" |
| 64 | rayon = "1.6.1" |
| 65 | futures = "0.3.28" |
| 66 | tempfile = "3.12.0" |
| 67 | static_assertions = "1.1.0" |
| 68 | uuid = { version = "1.10.0" , features = ["v4" ] } |
| 69 | |
| 70 | [build-dependencies] |
| 71 | pyo3-build-config = { path = "pyo3-build-config" , version = "=0.24.2" , features = ["resolve-config" ] } |
| 72 | |
| 73 | [features] |
| 74 | default = ["macros" ] |
| 75 | |
| 76 | # Enables support for `async fn` for `#[pyfunction]` and `#[pymethods]`. |
| 77 | experimental-async = ["macros" , "pyo3-macros/experimental-async" ] |
| 78 | |
| 79 | # Enables pyo3::inspect module and additional type information on FromPyObject |
| 80 | # and IntoPy traits |
| 81 | experimental-inspect = [] |
| 82 | |
| 83 | # Enables macros: #[pyclass], #[pymodule], #[pyfunction] etc. |
| 84 | macros = ["pyo3-macros" , "indoc" , "unindent" ] |
| 85 | |
| 86 | # Enables multiple #[pymethods] per #[pyclass] |
| 87 | multiple-pymethods = ["inventory" , "pyo3-macros/multiple-pymethods" ] |
| 88 | |
| 89 | # Use this feature when building an extension module. |
| 90 | # It tells the linker to keep the python symbols unresolved, |
| 91 | # so that the module can also be used with statically linked python interpreters. |
| 92 | extension-module = ["pyo3-ffi/extension-module" ] |
| 93 | |
| 94 | # Use the Python limited API. See https://www.python.org/dev/peps/pep-0384/ for more. |
| 95 | abi3 = ["pyo3-build-config/abi3" , "pyo3-ffi/abi3" ] |
| 96 | |
| 97 | # With abi3, we can manually set the minimum Python version. |
| 98 | abi3-py37 = ["abi3-py38" , "pyo3-build-config/abi3-py37" , "pyo3-ffi/abi3-py37" ] |
| 99 | abi3-py38 = ["abi3-py39" , "pyo3-build-config/abi3-py38" , "pyo3-ffi/abi3-py38" ] |
| 100 | abi3-py39 = ["abi3-py310" , "pyo3-build-config/abi3-py39" , "pyo3-ffi/abi3-py39" ] |
| 101 | abi3-py310 = ["abi3-py311" , "pyo3-build-config/abi3-py310" , "pyo3-ffi/abi3-py310" ] |
| 102 | abi3-py311 = ["abi3-py312" , "pyo3-build-config/abi3-py311" , "pyo3-ffi/abi3-py311" ] |
| 103 | abi3-py312 = ["abi3-py313" , "pyo3-build-config/abi3-py312" , "pyo3-ffi/abi3-py312" ] |
| 104 | abi3-py313 = ["abi3" , "pyo3-build-config/abi3-py313" , "pyo3-ffi/abi3-py313" ] |
| 105 | |
| 106 | # Automatically generates `python3.dll` import libraries for Windows targets. |
| 107 | generate-import-lib = ["pyo3-ffi/generate-import-lib" ] |
| 108 | |
| 109 | # Changes `Python::with_gil` to automatically initialize the Python interpreter if needed. |
| 110 | auto-initialize = [] |
| 111 | |
| 112 | # Enables `Clone`ing references to Python objects `Py<T>` which panics if the GIL is not held. |
| 113 | py-clone = [] |
| 114 | |
| 115 | # Optimizes PyObject to Vec conversion and so on. |
| 116 | nightly = [] |
| 117 | |
| 118 | # Activates all additional features |
| 119 | # This is mostly intended for testing purposes - activating *all* of these isn't particularly useful. |
| 120 | full = [ |
| 121 | "macros" , |
| 122 | # "multiple-pymethods", # Not supported by wasm |
| 123 | "anyhow" , |
| 124 | "chrono" , |
| 125 | "chrono-tz" , |
| 126 | "either" , |
| 127 | "experimental-async" , |
| 128 | "experimental-inspect" , |
| 129 | "eyre" , |
| 130 | "hashbrown" , |
| 131 | "indexmap" , |
| 132 | "num-bigint" , |
| 133 | "num-complex" , |
| 134 | "num-rational" , |
| 135 | "py-clone" , |
| 136 | "rust_decimal" , |
| 137 | "serde" , |
| 138 | "smallvec" , |
| 139 | "uuid" , |
| 140 | ] |
| 141 | |
| 142 | [workspace] |
| 143 | members = [ |
| 144 | "pyo3-ffi" , |
| 145 | "pyo3-build-config" , |
| 146 | "pyo3-macros" , |
| 147 | "pyo3-macros-backend" , |
| 148 | "pytests" , |
| 149 | "examples" , |
| 150 | ] |
| 151 | |
| 152 | [package.metadata.docs.rs] |
| 153 | no-default-features = true |
| 154 | features = ["full" ] |
| 155 | rustdoc-args = ["--cfg" , "docsrs" ] |
| 156 | |
| 157 | [workspace.lints.clippy] |
| 158 | checked_conversions = "warn" |
| 159 | dbg_macro = "warn" |
| 160 | explicit_into_iter_loop = "warn" |
| 161 | explicit_iter_loop = "warn" |
| 162 | filter_map_next = "warn" |
| 163 | flat_map_option = "warn" |
| 164 | let_unit_value = "warn" |
| 165 | manual_assert = "warn" |
| 166 | manual_ok_or = "warn" |
| 167 | todo = "warn" |
| 168 | unnecessary_wraps = "warn" |
| 169 | useless_transmute = "warn" |
| 170 | used_underscore_binding = "warn" |
| 171 | |
| 172 | [workspace.lints.rust] |
| 173 | elided_lifetimes_in_paths = "warn" |
| 174 | invalid_doc_attributes = "warn" |
| 175 | rust_2018_idioms = { level = "warn" , priority = -1 } |
| 176 | rust_2021_prelude_collisions = "warn" |
| 177 | unused_lifetimes = "warn" |
| 178 | unsafe_op_in_unsafe_fn = "warn" |
| 179 | |
| 180 | [workspace.lints.rustdoc] |
| 181 | broken_intra_doc_links = "warn" |
| 182 | bare_urls = "warn" |
| 183 | |
| 184 | [lints] |
| 185 | workspace = true |
| 186 | |