()
| 57 | } |
| 58 | |
| 59 | protected async handleLoadedCache() { |
| 60 | await super.handleLoadedCache(); |
| 61 | |
| 62 | // After the cache is loaded -- make sure virtualenvs use the correct Python version (the one that we have just installed). |
| 63 | // This will handle invalid caches, recreating virtualenvs if necessary. |
| 64 | |
| 65 | const pythonLocation = await io.which('python'); |
| 66 | if (pythonLocation) { |
| 67 | core.debug(`pythonLocation is ${pythonLocation}`); |
| 68 | } else { |
| 69 | logWarning('python binaries were not found in PATH'); |
| 70 | return; |
| 71 | } |
| 72 | |
| 73 | for (const poetryProject of this.poetryProjects) { |
| 74 | const {exitCode, stderr} = await exec.getExecOutput( |
| 75 | 'poetry', |
| 76 | ['env', 'use', pythonLocation], |
| 77 | {ignoreReturnCode: true, cwd: poetryProject} |
| 78 | ); |
| 79 | |
| 80 | if (exitCode) { |
| 81 | logWarning(stderr); |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | private async getPoetryConfiguration(basedir: string) { |
| 87 | const {stdout, stderr, exitCode} = await exec.getExecOutput( |
no test coverage detected