MCPcopy Create free account
hub / github.com/celer-pkg/celer / checkCPythonVersionConflict

Method checkCPythonVersionConflict

configs/port_install.go:1333–1352  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1331}
1332
1333func (p *Port) checkCPythonVersionConflict() error {
1334 cpythonVer := p.cpythonDepVersion()
1335 if cpythonVer == "" {
1336 return nil
1337 }
1338 cpythonMinor := expr.GetMinorVersion(cpythonVer)
1339
1340 venvVersion := buildtools.GetDefaultPythonVersion()
1341 if pythonConfig := p.ctx.PythonConfig(); pythonConfig != nil && pythonConfig.GetVersion() != "" {
1342 venvVersion = pythonConfig.GetVersion()
1343 }
1344 venvMinor := expr.GetMinorVersion(venvVersion)
1345
1346 if cpythonMinor != venvMinor {
1347 return fmt.Errorf("cpython dependency version %s does not match venv python version %s "+
1348 "(cpython minor %s vs venv minor %s); set [python] version in celer.toml to match the cpython dependency",
1349 cpythonVer, venvVersion, cpythonMinor, venvMinor)
1350 }
1351 return nil
1352}
1353
1354func (p Port) cpythonDepVersion() string {
1355 for _, nameVersion := range p.MatchedConfig.Dependencies {

Callers 1

InstallFromSourceMethod · 0.95

Calls 5

cpythonDepVersionMethod · 0.95
GetMinorVersionFunction · 0.92
GetDefaultPythonVersionFunction · 0.92
PythonConfigMethod · 0.65
GetVersionMethod · 0.65

Tested by

no test coverage detected