(config: &NeMoGuardrailsConfig)
| 670 | } |
| 671 | |
| 672 | fn 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 | |
| 686 | fn env_executable(name: &str) -> Option<String> { |
| 687 | env::var(name) |
no test coverage detected