diff --git a/Cargo.toml b/Cargo.toml index e9e14fa6..8f903e3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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", diff --git a/build.rs b/build.rs index 04ea5a47..d537bdef 100644 --- a/build.rs +++ b/build.rs @@ -757,7 +757,7 @@ fn configure(interpreter_config: &InterpreterConfig) -> Result { 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"); }