Introduce all-apis feature to support abi3

This commit is contained in:
kngwyu 2020-09-05 17:52:41 +09:00
parent 62a175e398
commit d2a10b688f
2 changed files with 6 additions and 7 deletions

View file

@ -33,8 +33,12 @@ trybuild = "1.0.23"
rustversion = "1.0"
[features]
default = ["macros"]
default = ["macros", "all-apis"]
macros = ["ctor", "indoc", "inventory", "paste", "pyo3cls", "unindent"]
# Enable the use of `not(Py_LIMITED_API)` s.
# This is incompatible with abi3(PEP384). See https://www.python.org/dev/peps/pep-0384/ more.
all-apis = []
# Optimizes PyObject to Vec conversion and so on.
nightly = []
@ -46,11 +50,6 @@ python3 = []
# so that the module can also be used with statically linked python interpreters.
extension-module = []
# The stable cpython abi as defined in PEP 384. Currently broken with
# many compilation errors. Pull Requests working towards fixing that
# are welcome.
# abi3 = []
[workspace]
members = [
"pyo3cls",

View file

@ -757,7 +757,7 @@ fn configure(interpreter_config: &InterpreterConfig) -> Result<String> {
bail!("Python 2 is not supported");
}
if env::var_os("CARGO_FEATURE_ABI3").is_some() {
if env::var_os("CARGO_FEATURE_ALL_APIS").is_none() {
println!("cargo:rustc-cfg=Py_LIMITED_API");
}