Require opt-in to use alternative Python implementations (#7650)

Closes #7118 

This only really affects managed interpreters, as we exclude alternative
Python implementations from the search path during the
`VersionRequest::executable_names` part of discovery.
This commit is contained in:
Zanie Blue
2024-09-24 12:52:15 -05:00
committed by GitHub
parent da328379c1
commit a53ddaa24a
6 changed files with 100 additions and 14 deletions
+10 -4
View File
@@ -52,8 +52,8 @@ impl LenientImplementationName {
}
impl From<&ImplementationName> for &'static str {
fn from(v: &ImplementationName) -> &'static str {
match v {
fn from(value: &ImplementationName) -> &'static str {
match value {
ImplementationName::CPython => "cpython",
ImplementationName::PyPy => "pypy",
ImplementationName::GraalPy => "graalpy",
@@ -61,9 +61,15 @@ impl From<&ImplementationName> for &'static str {
}
}
impl From<ImplementationName> for &'static str {
fn from(value: ImplementationName) -> &'static str {
(&value).into()
}
}
impl<'a> From<&'a LenientImplementationName> for &'a str {
fn from(v: &'a LenientImplementationName) -> &'a str {
match v {
fn from(value: &'a LenientImplementationName) -> &'a str {
match value {
LenientImplementationName::Known(implementation) => implementation.into(),
LenientImplementationName::Unknown(name) => name,
}