(ctx context.Context)
| 338 | } |
| 339 | |
| 340 | func shouldUseConda(ctx context.Context) bool { |
| 341 | // If no Python config or version is specified, use system Python. |
| 342 | pythonConfig := ctx.PythonConfig() |
| 343 | if pythonConfig == nil || pythonConfig.GetVersion() == "" { |
| 344 | return false |
| 345 | } |
| 346 | |
| 347 | // Use conda if specified Python version doesn't match system |
| 348 | // default version to avoid potential version mismatch issues. |
| 349 | systemDefault := GetDefaultPythonVersion() |
| 350 | return normalizeVersion(pythonConfig.GetVersion()) != normalizeVersion(systemDefault) |
| 351 | } |
| 352 | |
| 353 | func normalizeVersion(fullVersion string) string { |
| 354 | parts := strings.Split(fullVersion, ".") |
no test coverage detected