MCPcopy Index your code
hub / github.com/celer-pkg/celer / shouldUseConda

Function shouldUseConda

buildtools/setup_python.go:340–351  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

338}
339
340func 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
353func normalizeVersion(fullVersion string) string {
354 parts := strings.Split(fullVersion, ".")

Callers 1

CheckToolsFunction · 0.85

Calls 4

GetDefaultPythonVersionFunction · 0.85
normalizeVersionFunction · 0.85
PythonConfigMethod · 0.65
GetVersionMethod · 0.65

Tested by

no test coverage detected