MCPcopy Create free account
hub / github.com/NVIDIA/NeMo-Relay / python_executable

Function python_executable

crates/core/src/plugins/nemo_guardrails/python.rs:672–684  ·  view source on GitHub ↗
(config: &NeMoGuardrailsConfig)

Source from the content-addressed store, hash-verified

670}
671
672fn python_executable(config: &NeMoGuardrailsConfig) -> String {
673 config
674 .local
675 .as_ref()
676 .and_then(|local| local.python_executable.as_deref())
677 .map(str::trim)
678 .filter(|value| !value.is_empty())
679 .map(str::to_string)
680 .or_else(|| env_executable(PYTHON_EXECUTABLE_ENV))
681 .or_else(|| env_executable(PYO3_PYTHON_ENV))
682 .or_else(|| env_executable(UV_PYTHON_ENV))
683 .unwrap_or_else(|| DEFAULT_PYTHON_EXECUTABLE.to_string())
684}
685
686fn env_executable(name: &str) -> Option<String> {
687 env::var(name)

Callers 1

startMethod · 0.85

Calls 2

env_executableFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected