()
| 1331 | } |
| 1332 | |
| 1333 | func (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 | |
| 1354 | func (p Port) cpythonDepVersion() string { |
| 1355 | for _, nameVersion := range p.MatchedConfig.Dependencies { |
no test coverage detected