MCPcopy Index your code
hub / github.com/actions/setup-python / handleLoadedCache

Method handleLoadedCache

src/cache-distributions/poetry-cache.ts:59–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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(

Callers 1

restoreCacheFunction · 0.80

Calls 1

logWarningFunction · 0.90

Tested by

no test coverage detected