[package] name = "pyo3" version = "0.17.3" description = "Bindings to Python interpreter" authors = ["PyO3 Project and Contributors "] 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 = "Apache-2.0" exclude = ["/.gitignore", ".cargo/config", "/codecov.yml", "/Makefile", "/pyproject.toml", "/noxfile.py"] edition = "2018" [dependencies] cfg-if = "1.0" libc = "0.2.62" parking_lot = ">= 0.11, < 0.13" memoffset = "0.7" # ffi bindings to the python interpreter, split into a separate crate so they can be used independently pyo3-ffi = { path = "pyo3-ffi", version = "=0.17.3" } # support crates for macros feature pyo3-macros = { path = "pyo3-macros", version = "=0.17.3", optional = true } indoc = { version = "1.0.3", optional = true } unindent = { version = "0.1.4", optional = true } # support crate for multiple-pymethods feature inventory = { version = "0.3.0", optional = true } # crate integrations that can be added using the eponymous features anyhow = { version = "1.0", optional = true } chrono = { version = "0.4", optional = true } eyre = { version = ">= 0.4, < 0.7", optional = true } hashbrown = { version = ">= 0.9, < 0.13", optional = true } indexmap = { version = ">= 1.6, < 1.8", optional = true } num-bigint = { version = "0.4", optional = true } num-complex = { version = ">= 0.2, < 0.5", optional = true } serde = { version = "1.0", optional = true } [dev-dependencies] assert_approx_eq = "1.1.0" chrono = { version = "0.4" } criterion = "0.3.5" # Required for "and $N others" normalization trybuild = ">=1.0.70" rustversion = "1.0" # 1.0.0 requires Rust 1.50 proptest = { version = "0.10.1", default-features = false, features = ["std"] } send_wrapper = "0.5" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0.61" rayon = "1.0.2" widestring = "0.5.1" [build-dependencies] pyo3-build-config = { path = "pyo3-build-config", version = "0.17.3", features = ["resolve-config"] } [features] default = ["macros"] # Enables macros: #[pyclass], #[pymodule], #[pyfunction] etc. macros = ["pyo3-macros", "indoc", "unindent"] # Enables multiple #[pymethods] per #[pyclass] multiple-pymethods = ["inventory", "pyo3-macros/multiple-pymethods"] # Use this feature when building an extension module. # It tells the linker to keep the python symbols unresolved, # so that the module can also be used with statically linked python interpreters. 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", "pyo3-macros/abi3"] # With abi3, we can manually set the minimum Python version. abi3-py37 = ["abi3-py38", "pyo3-build-config/abi3-py37", "pyo3-ffi/abi3-py37"] 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", "pyo3-build-config/abi3-py310", "pyo3-ffi/abi3-py310"] # Automatically generates `python3.dll` import libraries for Windows targets. generate-import-lib = ["pyo3-ffi/generate-import-lib"] # Deprecated, replaced by `generate-import-lib` generate-abi3-import-lib = ["generate-import-lib"] # Changes `Python::with_gil` and `Python::acquire_gil` to automatically initialize the # Python interpreter if needed. auto-initialize = [] # 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", # TODO re-add this when MSRV is greater than 1.62 "chrono", "num-bigint", "num-complex", "hashbrown", "serde", "indexmap", "eyre", "anyhow", ] [[bench]] name = "bench_call" harness = false [[bench]] name = "bench_err" harness = false [[bench]] name = "bench_dict" harness = false [[bench]] name = "bench_frompyobject" harness = false required-features = ["macros"] [[bench]] name = "bench_gil" harness = false [[bench]] name = "bench_list" harness = false [[bench]] name = "bench_pyclass" harness = false required-features = ["macros"] [[bench]] name = "bench_pyobject" harness = false [[bench]] name = "bench_set" harness = false [[bench]] name = "bench_tuple" harness = false [[bench]] name = "bench_intern" harness = false [workspace] members = [ "pyo3-ffi", "pyo3-build-config", "pyo3-macros", "pyo3-macros-backend", "pytests", "examples", "xtask" ] [package.metadata.docs.rs] no-default-features = true features = ["macros", "num-bigint", "num-complex", "hashbrown", "serde", "multiple-pymethods", "indexmap", "eyre", "chrono"] rustdoc-args = ["--cfg", "docsrs"]