82d9b44f5e
PyOxidizer has crates depending on `pyo3` that would like to access the `pyo3` crate configuration. (This use case isn't unique to PyOxidizer.) Cargo has a facility for enabling the build scripts of dependent crates to access _exported_ variables via `DEP_` environment variables. However, this only works if the exporting crate defines a `links` key in its Cargo manifest. See https://doc.rust-lang.org/cargo/reference/build-scripts.html#the-links-manifest-key. While `pyo3`'s build script doesn't yet export the variables that PyOxidizer will need, a prerequisite to making this work is adding the `links` key. Since this change could introduce unintended side-effects, it warrants being made in its own commit, which is why we're making this change outside of #1793. I _think_ this change should be mostly safe: the `links` key is effectively metadata advertising that a crate links against a named library. The only side-effects setting it has is to enable the aforementioned `DEP_` environment variables in build scripts and enforcing a limitation that only a single crate may link against the same native library. I believe the only potential for this change to cause problems is if there are multiple crates with `links = "python"` entries. I'm not aware of any other crates that advertise `links = "python"`: even `python3-sys` / `cpython` use `links = "python3"` so this change should not prevent dual use of `pyo3` and `cpython` in the same build.
129 lines
3.7 KiB
TOML
129 lines
3.7 KiB
TOML
[package]
|
|
name = "pyo3"
|
|
version = "0.14.4"
|
|
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 = "Apache-2.0"
|
|
exclude = ["/.gitignore", ".cargo/config", "/codecov.yml", "/Makefile", "/pyproject.toml", "/tox.ini"]
|
|
edition = "2018"
|
|
links = "python"
|
|
|
|
[dependencies]
|
|
cfg-if = { version = "1.0" }
|
|
# must stay at 0.3.x for Rust 1.41 compatibility
|
|
indoc = { version = "0.3.6", optional = true }
|
|
inventory = { version = "0.1.4", optional = true }
|
|
libc = "0.2.62"
|
|
parking_lot = "0.11.0"
|
|
num-bigint = { version = "0.4", optional = true }
|
|
num-complex = { version = ">= 0.2, < 0.5", optional = true }
|
|
# must stay at 0.1.x for Rust 1.41 compatibility
|
|
paste = { version = "0.1.18", optional = true }
|
|
pyo3-macros = { path = "pyo3-macros", version = "=0.14.4", optional = true }
|
|
unindent = { version = "0.1.4", optional = true }
|
|
hashbrown = { version = ">= 0.9, < 0.12", optional = true }
|
|
indexmap = { version = ">= 1.6, < 1.8", optional = true }
|
|
serde = {version = "1.0", optional = true}
|
|
|
|
[dev-dependencies]
|
|
assert_approx_eq = "1.1.0"
|
|
# O.3.5 uses the matches! macro, which isn't compatible with Rust 1.41
|
|
criterion = "=0.3.4"
|
|
trybuild = "1.0.45"
|
|
rustversion = "1.0"
|
|
proptest = { version = "0.10.1", default-features = false, features = ["std"] }
|
|
# features needed to run the PyO3 test suite
|
|
pyo3 = { path = ".", default-features = false, features = ["macros", "auto-initialize"] }
|
|
serde_json = "1.0.61"
|
|
|
|
[build-dependencies]
|
|
pyo3-build-config = { path = "pyo3-build-config", version = "0.14.4" }
|
|
|
|
[features]
|
|
default = ["macros"]
|
|
|
|
# Enables macros: #[pyclass], #[pymodule], #[pyfunction] etc.
|
|
macros = ["pyo3-macros", "indoc", "paste", "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 = []
|
|
|
|
# Use the Python limited API. See https://www.python.org/dev/peps/pep-0384/ for more.
|
|
abi3 = ["pyo3-build-config/abi3"]
|
|
|
|
# With abi3, we can manually set the minimum Python version.
|
|
abi3-py36 = ["abi3-py37", "pyo3-build-config/abi3-py36"]
|
|
abi3-py37 = ["abi3-py38", "pyo3-build-config/abi3-py37"]
|
|
abi3-py38 = ["abi3-py39", "pyo3-build-config/abi3-py38"]
|
|
abi3-py39 = ["abi3", "pyo3-build-config/abi3-py39"]
|
|
|
|
# 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 = []
|
|
|
|
[[bench]]
|
|
name = "bench_call"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "bench_err"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "bench_dict"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "bench_gil"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "bench_list"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "bench_pyclass"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "bench_pyobject"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "bench_set"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "bench_tuple"
|
|
harness = false
|
|
|
|
[workspace]
|
|
members = [
|
|
"pyo3-macros",
|
|
"pyo3-macros-backend",
|
|
"examples/pyo3-benchmarks",
|
|
"examples/pyo3-pytests",
|
|
"examples/maturin-starter",
|
|
"examples/setuptools-rust-starter",
|
|
"examples/word-count"
|
|
]
|
|
|
|
[package.metadata.docs.rs]
|
|
no-default-features = true
|
|
features = ["macros", "num-bigint", "num-complex", "hashbrown", "serde", "multiple-pymethods", "indexmap"]
|
|
rustdoc-args = ["--cfg", "docsrs"]
|