Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pyo3-build-config/src/impl_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ impl InterpreterConfig {
PythonImplementation::CPython => {}
PythonImplementation::PyPy => out.push("cargo:rustc-cfg=PyPy".to_owned()),
PythonImplementation::GraalPy => out.push("cargo:rustc-cfg=GraalPy".to_owned()),
PythonImplementation::RustPython => out.push("cargo:rustc-cfg=RustPython".to_owned()),
}

// If Py_GIL_DISABLED is set, do not build with limited API support
Expand Down Expand Up @@ -780,6 +781,7 @@ pub enum PythonImplementation {
CPython,
PyPy,
GraalPy,
RustPython,
}

impl PythonImplementation {
Expand Down Expand Up @@ -813,6 +815,7 @@ impl Display for PythonImplementation {
PythonImplementation::CPython => write!(f, "CPython"),
PythonImplementation::PyPy => write!(f, "PyPy"),
PythonImplementation::GraalPy => write!(f, "GraalVM"),
PythonImplementation::RustPython => write!(f, "RustPython"),
}
}
}
Expand All @@ -824,6 +827,7 @@ impl FromStr for PythonImplementation {
"CPython" => Ok(PythonImplementation::CPython),
"PyPy" => Ok(PythonImplementation::PyPy),
"GraalVM" => Ok(PythonImplementation::GraalPy),
"RustPython" => Ok(PythonImplementation::RustPython),
_ => bail!("unknown interpreter: {}", s),
}
}
Expand Down Expand Up @@ -1768,6 +1772,7 @@ fn default_lib_name_unix(
},

PythonImplementation::GraalPy => Ok("python-native".to_string()),
PythonImplementation::RustPython => Ok("rustpython-capi".to_string()),
}
}

Expand Down
2 changes: 2 additions & 0 deletions pyo3-build-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ pub fn print_expected_cfgs() {
println!("cargo:rustc-check-cfg=cfg(Py_GIL_DISABLED)");
println!("cargo:rustc-check-cfg=cfg(PyPy)");
println!("cargo:rustc-check-cfg=cfg(GraalPy)");
println!("cargo:rustc-check-cfg=cfg(RustPython)");
println!("cargo:rustc-check-cfg=cfg(py_sys_config, values(\"Py_DEBUG\", \"Py_REF_DEBUG\", \"Py_TRACE_REFS\", \"COUNT_ALLOCS\"))");
println!("cargo:rustc-check-cfg=cfg(pyo3_disable_reference_pool)");
println!("cargo:rustc-check-cfg=cfg(pyo3_leak_on_drop_without_reference_pool)");
Expand Down Expand Up @@ -393,6 +394,7 @@ pub mod pyo3_build_script_impl {
PythonImplementation::CPython => "Python",
PythonImplementation::PyPy => "PyPy",
PythonImplementation::GraalPy => "GraalPy",
PythonImplementation::RustPython => "RustPython",
};
let version = &interpreter_config.version;
let message = format!(
Expand Down
2 changes: 2 additions & 0 deletions pyo3-ffi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ fn ensure_python_version(interpreter_config: &InterpreterConfig) -> Result<()> {
return Err(error.finish().into());
}
}
PythonImplementation::RustPython => {}
}

if interpreter_config.abi3 {
Expand All @@ -140,6 +141,7 @@ fn ensure_python_version(interpreter_config: &InterpreterConfig) -> Result<()> {
PythonImplementation::GraalPy => warn!(
"GraalPy does not support abi3 so the build artifacts will be version-specific."
),
PythonImplementation::RustPython => {}
}
}

Expand Down
Loading