1
0
Fork 0
mirror of https://github.com/actions/setup-python.git synced 2024-09-20 00:56:43 +00:00

Use @tsonfig/node16

This commit is contained in:
Jamie Magee 2023-04-16 17:14:52 -07:00
parent df6abcc733
commit 4e025854d4
5 changed files with 645 additions and 821 deletions

View file

@ -59977,7 +59977,11 @@ module.exports = v4;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@ -59994,15 +59998,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.State = void 0; exports.State = void 0;
const cache = __importStar(__nccwpck_require__(7799)); const cache = __importStar(__nccwpck_require__(7799));
@ -60020,12 +60015,9 @@ class CacheDistributor {
this.cacheDependencyPath = cacheDependencyPath; this.cacheDependencyPath = cacheDependencyPath;
this.CACHE_KEY_PREFIX = 'setup-python'; this.CACHE_KEY_PREFIX = 'setup-python';
} }
handleLoadedCache() { async handleLoadedCache() { }
return __awaiter(this, void 0, void 0, function* () { }); async restoreCache() {
} const { primaryKey, restoreKey } = await this.computeKeys();
restoreCache() {
return __awaiter(this, void 0, void 0, function* () {
const { primaryKey, restoreKey } = yield this.computeKeys();
if (primaryKey.endsWith('-')) { if (primaryKey.endsWith('-')) {
const file = this.packageManager === 'pip' const file = this.packageManager === 'pip'
? `${this.cacheDependencyPath ? `${this.cacheDependencyPath
@ -60034,11 +60026,11 @@ class CacheDistributor {
: this.cacheDependencyPath.split('\n').join(','); : this.cacheDependencyPath.split('\n').join(',');
throw new Error(`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository`); throw new Error(`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository`);
} }
const cachePath = yield this.getCacheGlobalDirectories(); const cachePath = await this.getCacheGlobalDirectories();
core.saveState(State.CACHE_PATHS, cachePath); core.saveState(State.CACHE_PATHS, cachePath);
let matchedKey; let matchedKey;
try { try {
matchedKey = yield cache.restoreCache(cachePath, primaryKey, restoreKey); matchedKey = await cache.restoreCache(cachePath, primaryKey, restoreKey);
} }
catch (err) { catch (err) {
const message = err.message; const message = err.message;
@ -60047,9 +60039,8 @@ class CacheDistributor {
return; return;
} }
core.saveState(State.STATE_CACHE_PRIMARY_KEY, primaryKey); core.saveState(State.STATE_CACHE_PRIMARY_KEY, primaryKey);
yield this.handleLoadedCache(); await this.handleLoadedCache();
this.handleMatchResult(matchedKey, primaryKey); this.handleMatchResult(matchedKey, primaryKey);
});
} }
handleMatchResult(matchedKey, primaryKey) { handleMatchResult(matchedKey, primaryKey) {
if (matchedKey) { if (matchedKey) {
@ -60086,7 +60077,11 @@ exports.CACHE_DEPENDENCY_BACKUP_PATH = '**/pyproject.toml';
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@ -60103,15 +60098,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) { var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
@ -60121,23 +60107,20 @@ const core = __importStar(__nccwpck_require__(2186));
const cache = __importStar(__nccwpck_require__(7799)); const cache = __importStar(__nccwpck_require__(7799));
const fs_1 = __importDefault(__nccwpck_require__(7147)); const fs_1 = __importDefault(__nccwpck_require__(7147));
const cache_distributor_1 = __nccwpck_require__(8953); const cache_distributor_1 = __nccwpck_require__(8953);
function run() { async function run() {
return __awaiter(this, void 0, void 0, function* () {
try { try {
const cache = core.getInput('cache'); const cache = core.getInput('cache');
if (cache) { if (cache) {
yield saveCache(cache); await saveCache(cache);
} }
} }
catch (error) { catch (error) {
const err = error; const err = error;
core.setFailed(err.message); core.setFailed(err.message);
} }
});
} }
exports.run = run; exports.run = run;
function saveCache(packageManager) { async function saveCache(packageManager) {
return __awaiter(this, void 0, void 0, function* () {
const cachePathState = core.getState(cache_distributor_1.State.CACHE_PATHS); const cachePathState = core.getState(cache_distributor_1.State.CACHE_PATHS);
if (!cachePathState) { if (!cachePathState) {
core.warning('Cache paths are empty. Please check the previous logs and make sure that the python version is specified'); core.warning('Cache paths are empty. Please check the previous logs and make sure that the python version is specified');
@ -60161,7 +60144,7 @@ function saveCache(packageManager) {
} }
let cacheId = 0; let cacheId = 0;
try { try {
cacheId = yield cache.saveCache(cachePaths, primaryKey); cacheId = await cache.saveCache(cachePaths, primaryKey);
} }
catch (err) { catch (err) {
const message = err.message; const message = err.message;
@ -60172,7 +60155,6 @@ function saveCache(packageManager) {
return; return;
} }
core.info(`Cache saved with the key: ${primaryKey}`); core.info(`Cache saved with the key: ${primaryKey}`);
});
} }
function isCacheDirectoryExists(cacheDirectory) { function isCacheDirectoryExists(cacheDirectory) {
const result = cacheDirectory.reduce((previousValue, currentValue) => { const result = cacheDirectory.reduce((previousValue, currentValue) => {

418
dist/setup/index.js vendored
View file

@ -67289,7 +67289,11 @@ try {
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@ -67306,15 +67310,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.State = void 0; exports.State = void 0;
const cache = __importStar(__nccwpck_require__(7799)); const cache = __importStar(__nccwpck_require__(7799));
@ -67332,12 +67327,9 @@ class CacheDistributor {
this.cacheDependencyPath = cacheDependencyPath; this.cacheDependencyPath = cacheDependencyPath;
this.CACHE_KEY_PREFIX = 'setup-python'; this.CACHE_KEY_PREFIX = 'setup-python';
} }
handleLoadedCache() { async handleLoadedCache() { }
return __awaiter(this, void 0, void 0, function* () { }); async restoreCache() {
} const { primaryKey, restoreKey } = await this.computeKeys();
restoreCache() {
return __awaiter(this, void 0, void 0, function* () {
const { primaryKey, restoreKey } = yield this.computeKeys();
if (primaryKey.endsWith('-')) { if (primaryKey.endsWith('-')) {
const file = this.packageManager === 'pip' const file = this.packageManager === 'pip'
? `${this.cacheDependencyPath ? `${this.cacheDependencyPath
@ -67346,11 +67338,11 @@ class CacheDistributor {
: this.cacheDependencyPath.split('\n').join(','); : this.cacheDependencyPath.split('\n').join(',');
throw new Error(`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository`); throw new Error(`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository`);
} }
const cachePath = yield this.getCacheGlobalDirectories(); const cachePath = await this.getCacheGlobalDirectories();
core.saveState(State.CACHE_PATHS, cachePath); core.saveState(State.CACHE_PATHS, cachePath);
let matchedKey; let matchedKey;
try { try {
matchedKey = yield cache.restoreCache(cachePath, primaryKey, restoreKey); matchedKey = await cache.restoreCache(cachePath, primaryKey, restoreKey);
} }
catch (err) { catch (err) {
const message = err.message; const message = err.message;
@ -67359,9 +67351,8 @@ class CacheDistributor {
return; return;
} }
core.saveState(State.STATE_CACHE_PRIMARY_KEY, primaryKey); core.saveState(State.STATE_CACHE_PRIMARY_KEY, primaryKey);
yield this.handleLoadedCache(); await this.handleLoadedCache();
this.handleMatchResult(matchedKey, primaryKey); this.handleMatchResult(matchedKey, primaryKey);
});
} }
handleMatchResult(matchedKey, primaryKey) { handleMatchResult(matchedKey, primaryKey) {
if (matchedKey) { if (matchedKey) {
@ -67434,7 +67425,11 @@ exports.CACHE_DEPENDENCY_BACKUP_PATH = '**/pyproject.toml';
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@ -67451,15 +67446,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) { var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
@ -67480,8 +67466,7 @@ class PipCache extends cache_distributor_1.default {
this.pythonVersion = pythonVersion; this.pythonVersion = pythonVersion;
this.cacheDependencyBackupPath = constants_1.CACHE_DEPENDENCY_BACKUP_PATH; this.cacheDependencyBackupPath = constants_1.CACHE_DEPENDENCY_BACKUP_PATH;
} }
getCacheGlobalDirectories() { async getCacheGlobalDirectories() {
return __awaiter(this, void 0, void 0, function* () {
let exitCode = 1; let exitCode = 1;
let stdout = ''; let stdout = '';
let stderr = ''; let stderr = '';
@ -67492,14 +67477,14 @@ class PipCache extends cache_distributor_1.default {
// Related issue: https://github.com/actions/setup-python/issues/328 // Related issue: https://github.com/actions/setup-python/issues/328
if (utils_1.IS_WINDOWS) { if (utils_1.IS_WINDOWS) {
const execPromisify = util_1.default.promisify(child_process.exec); const execPromisify = util_1.default.promisify(child_process.exec);
({ stdout: stdout, stderr: stderr } = yield execPromisify('pip cache dir')); ({ stdout: stdout, stderr: stderr } = await execPromisify('pip cache dir'));
} }
else { else {
({ ({
stdout: stdout, stdout: stdout,
stderr: stderr, stderr: stderr,
exitCode: exitCode exitCode: exitCode
} = yield exec.getExecOutput('pip cache dir')); } = await exec.getExecOutput('pip cache dir'));
} }
if (exitCode && stderr) { if (exitCode && stderr) {
throw new Error(`Could not get cache folder path for pip package manager`); throw new Error(`Could not get cache folder path for pip package manager`);
@ -67510,16 +67495,14 @@ class PipCache extends cache_distributor_1.default {
} }
core.debug(`global cache directory path is ${resolvedPath}`); core.debug(`global cache directory path is ${resolvedPath}`);
return [resolvedPath]; return [resolvedPath];
});
} }
computeKeys() { async computeKeys() {
return __awaiter(this, void 0, void 0, function* () { const hash = (await glob.hashFiles(this.cacheDependencyPath)) ||
const hash = (yield glob.hashFiles(this.cacheDependencyPath)) || (await glob.hashFiles(this.cacheDependencyBackupPath));
(yield glob.hashFiles(this.cacheDependencyBackupPath));
let primaryKey = ''; let primaryKey = '';
let restoreKey = ''; let restoreKey = '';
if (utils_1.IS_LINUX) { if (utils_1.IS_LINUX) {
const osInfo = yield utils_1.getLinuxInfo(); const osInfo = await (0, utils_1.getLinuxInfo)();
primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osInfo.osVersion}-${osInfo.osName}-python-${this.pythonVersion}-${this.packageManager}-${hash}`; primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osInfo.osVersion}-${osInfo.osName}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osInfo.osVersion}-${osInfo.osName}-python-${this.pythonVersion}-${this.packageManager}`; restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osInfo.osVersion}-${osInfo.osName}-python-${this.pythonVersion}-${this.packageManager}`;
} }
@ -67531,7 +67514,6 @@ class PipCache extends cache_distributor_1.default {
primaryKey, primaryKey,
restoreKey: [restoreKey] restoreKey: [restoreKey]
}; };
});
} }
} }
exports["default"] = PipCache; exports["default"] = PipCache;
@ -67546,7 +67528,11 @@ exports["default"] = PipCache;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@ -67563,15 +67549,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) { var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
@ -67587,8 +67564,7 @@ class PipenvCache extends cache_distributor_1.default {
this.pythonVersion = pythonVersion; this.pythonVersion = pythonVersion;
this.patterns = patterns; this.patterns = patterns;
} }
getCacheGlobalDirectories() { async getCacheGlobalDirectories() {
return __awaiter(this, void 0, void 0, function* () {
let virtualEnvRelativePath; let virtualEnvRelativePath;
// Default virtualenv directories are hardcoded, // Default virtualenv directories are hardcoded,
// because pipenv is not preinstalled on hosted images and virtualenv is not created: // because pipenv is not preinstalled on hosted images and virtualenv is not created:
@ -67602,18 +67578,15 @@ class PipenvCache extends cache_distributor_1.default {
const resolvedPath = path.join(os.homedir(), virtualEnvRelativePath); const resolvedPath = path.join(os.homedir(), virtualEnvRelativePath);
core.debug(`global cache directory path is ${resolvedPath}`); core.debug(`global cache directory path is ${resolvedPath}`);
return [resolvedPath]; return [resolvedPath];
});
} }
computeKeys() { async computeKeys() {
return __awaiter(this, void 0, void 0, function* () { const hash = await glob.hashFiles(this.patterns);
const hash = yield glob.hashFiles(this.patterns);
const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-${hash}`; const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
const restoreKey = undefined; const restoreKey = undefined;
return { return {
primaryKey, primaryKey,
restoreKey restoreKey
}; };
});
} }
} }
exports["default"] = PipenvCache; exports["default"] = PipenvCache;
@ -67628,7 +67601,11 @@ exports["default"] = PipenvCache;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@ -67645,22 +67622,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __asyncValues = (this && this.__asyncValues) || function (o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
};
var __importDefault = (this && this.__importDefault) || function (mod) { var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
@ -67679,19 +67640,15 @@ class PoetryCache extends cache_distributor_1.default {
this.patterns = patterns; this.patterns = patterns;
this.poetryProjects = poetryProjects; this.poetryProjects = poetryProjects;
} }
getCacheGlobalDirectories() { async getCacheGlobalDirectories() {
var e_1, _a;
return __awaiter(this, void 0, void 0, function* () {
// Same virtualenvs path may appear for different projects, hence we use a Set // Same virtualenvs path may appear for different projects, hence we use a Set
const paths = new Set(); const paths = new Set();
const globber = yield glob.create(this.patterns); const globber = await glob.create(this.patterns);
try { for await (const file of globber.globGenerator()) {
for (var _b = __asyncValues(globber.globGenerator()), _c; _c = yield _b.next(), !_c.done;) {
const file = _c.value;
const basedir = path.dirname(file); const basedir = path.dirname(file);
core.debug(`Processing Poetry project at ${basedir}`); core.debug(`Processing Poetry project at ${basedir}`);
this.poetryProjects.add(basedir); this.poetryProjects.add(basedir);
const poetryConfig = yield this.getPoetryConfiguration(basedir); const poetryConfig = await this.getPoetryConfiguration(basedir);
const cacheDir = poetryConfig['cache-dir']; const cacheDir = poetryConfig['cache-dir'];
const virtualenvsPath = poetryConfig['virtualenvs.path'].replace('{cache-dir}', cacheDir); const virtualenvsPath = poetryConfig['virtualenvs.path'].replace('{cache-dir}', cacheDir);
paths.add(virtualenvsPath); paths.add(virtualenvsPath);
@ -67699,20 +67656,10 @@ class PoetryCache extends cache_distributor_1.default {
paths.add(path.join(basedir, '.venv')); paths.add(path.join(basedir, '.venv'));
} }
} }
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
return [...paths]; return [...paths];
});
} }
computeKeys() { async computeKeys() {
return __awaiter(this, void 0, void 0, function* () { const hash = await glob.hashFiles(this.patterns);
const hash = yield glob.hashFiles(this.patterns);
// "v2" is here to invalidate old caches of this cache distributor, which were created broken: // "v2" is here to invalidate old caches of this cache distributor, which were created broken:
const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-v2-${hash}`; const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-v2-${hash}`;
const restoreKey = undefined; const restoreKey = undefined;
@ -67720,35 +67667,28 @@ class PoetryCache extends cache_distributor_1.default {
primaryKey, primaryKey,
restoreKey restoreKey
}; };
});
} }
handleLoadedCache() { async handleLoadedCache() {
const _super = Object.create(null, { await super.handleLoadedCache();
handleLoadedCache: { get: () => super.handleLoadedCache }
});
return __awaiter(this, void 0, void 0, function* () {
yield _super.handleLoadedCache.call(this);
// After the cache is loaded -- make sure virtualenvs use the correct Python version (the one that we have just installed). // After the cache is loaded -- make sure virtualenvs use the correct Python version (the one that we have just installed).
// This will handle invalid caches, recreating virtualenvs if necessary. // This will handle invalid caches, recreating virtualenvs if necessary.
const pythonLocation = yield io.which('python'); const pythonLocation = await io.which('python');
if (pythonLocation) { if (pythonLocation) {
core.debug(`pythonLocation is ${pythonLocation}`); core.debug(`pythonLocation is ${pythonLocation}`);
} }
else { else {
utils_1.logWarning('python binaries were not found in PATH'); (0, utils_1.logWarning)('python binaries were not found in PATH');
return; return;
} }
for (const poetryProject of this.poetryProjects) { for (const poetryProject of this.poetryProjects) {
const { exitCode, stderr } = yield exec.getExecOutput('poetry', ['env', 'use', pythonLocation], { ignoreReturnCode: true, cwd: poetryProject }); const { exitCode, stderr } = await exec.getExecOutput('poetry', ['env', 'use', pythonLocation], { ignoreReturnCode: true, cwd: poetryProject });
if (exitCode) { if (exitCode) {
utils_1.logWarning(stderr); (0, utils_1.logWarning)(stderr);
} }
} }
});
} }
getPoetryConfiguration(basedir) { async getPoetryConfiguration(basedir) {
return __awaiter(this, void 0, void 0, function* () { const { stdout, stderr, exitCode } = await exec.getExecOutput('poetry', ['config', '--list'], { cwd: basedir });
const { stdout, stderr, exitCode } = yield exec.getExecOutput('poetry', ['config', '--list'], { cwd: basedir });
if (exitCode && stderr) { if (exitCode && stderr) {
throw new Error('Could not get cache folder path for poetry package manager'); throw new Error('Could not get cache folder path for poetry package manager');
} }
@ -67760,7 +67700,6 @@ class PoetryCache extends cache_distributor_1.default {
config[key] = JSON.parse(value); config[key] = JSON.parse(value);
} }
return config; return config;
});
} }
} }
exports["default"] = PoetryCache; exports["default"] = PoetryCache;
@ -67775,7 +67714,11 @@ exports["default"] = PoetryCache;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@ -67792,15 +67735,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.findPyPyInstallDirForWindows = exports.parsePyPyVersion = exports.findPyPyToolCache = exports.findPyPyVersion = void 0; exports.findPyPyInstallDirForWindows = exports.parsePyPyVersion = exports.findPyPyToolCache = exports.findPyPyVersion = void 0;
const path = __importStar(__nccwpck_require__(1017)); const path = __importStar(__nccwpck_require__(1017));
@ -67809,15 +67743,14 @@ const utils_1 = __nccwpck_require__(1314);
const semver = __importStar(__nccwpck_require__(1383)); const semver = __importStar(__nccwpck_require__(1383));
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const tc = __importStar(__nccwpck_require__(7784)); const tc = __importStar(__nccwpck_require__(7784));
function findPyPyVersion(versionSpec, architecture, updateEnvironment, checkLatest, allowPreReleases) { async function findPyPyVersion(versionSpec, architecture, updateEnvironment, checkLatest, allowPreReleases) {
return __awaiter(this, void 0, void 0, function* () {
let resolvedPyPyVersion = ''; let resolvedPyPyVersion = '';
let resolvedPythonVersion = ''; let resolvedPythonVersion = '';
let installDir; let installDir;
let releases; let releases;
const pypyVersionSpec = parsePyPyVersion(versionSpec); const pypyVersionSpec = parsePyPyVersion(versionSpec);
if (checkLatest) { if (checkLatest) {
releases = yield pypyInstall.getAvailablePyPyVersions(); releases = await pypyInstall.getAvailablePyPyVersions();
if (releases && releases.length > 0) { if (releases && releases.length > 0) {
const releaseData = pypyInstall.findRelease(releases, pypyVersionSpec.pythonVersion, pypyVersionSpec.pypyVersion, architecture, false); const releaseData = pypyInstall.findRelease(releases, pypyVersionSpec.pythonVersion, pypyVersionSpec.pypyVersion, architecture, false);
if (releaseData) { if (releaseData) {
@ -67833,7 +67766,7 @@ function findPyPyVersion(versionSpec, architecture, updateEnvironment, checkLate
({ installDir, resolvedPythonVersion, resolvedPyPyVersion } = findPyPyToolCache(pypyVersionSpec.pythonVersion, pypyVersionSpec.pypyVersion, architecture)); ({ installDir, resolvedPythonVersion, resolvedPyPyVersion } = findPyPyToolCache(pypyVersionSpec.pythonVersion, pypyVersionSpec.pypyVersion, architecture));
if (!installDir) { if (!installDir) {
({ installDir, resolvedPythonVersion, resolvedPyPyVersion } = ({ installDir, resolvedPythonVersion, resolvedPyPyVersion } =
yield pypyInstall.installPyPy(pypyVersionSpec.pypyVersion, pypyVersionSpec.pythonVersion, architecture, allowPreReleases, releases)); await pypyInstall.installPyPy(pypyVersionSpec.pypyVersion, pypyVersionSpec.pythonVersion, architecture, allowPreReleases, releases));
} }
const pipDir = utils_1.IS_WINDOWS ? 'Scripts' : 'bin'; const pipDir = utils_1.IS_WINDOWS ? 'Scripts' : 'bin';
const _binDir = path.join(installDir, pipDir); const _binDir = path.join(installDir, pipDir);
@ -67855,7 +67788,6 @@ function findPyPyVersion(versionSpec, architecture, updateEnvironment, checkLate
core.setOutput('python-version', 'pypy' + resolvedPyPyVersion); core.setOutput('python-version', 'pypy' + resolvedPyPyVersion);
core.setOutput('python-path', pythonPath); core.setOutput('python-path', pythonPath);
return { resolvedPyPyVersion, resolvedPythonVersion }; return { resolvedPyPyVersion, resolvedPythonVersion };
});
} }
exports.findPyPyVersion = findPyPyVersion; exports.findPyPyVersion = findPyPyVersion;
function findPyPyToolCache(pythonVersion, pypyVersion, architecture) { function findPyPyToolCache(pythonVersion, pypyVersion, architecture) {
@ -67867,8 +67799,8 @@ function findPyPyToolCache(pythonVersion, pypyVersion, architecture) {
if (installDir) { if (installDir) {
// 'tc.find' finds tool based on Python version but we also need to check // 'tc.find' finds tool based on Python version but we also need to check
// whether PyPy version satisfies requested version. // whether PyPy version satisfies requested version.
resolvedPythonVersion = utils_1.getPyPyVersionFromPath(installDir); resolvedPythonVersion = (0, utils_1.getPyPyVersionFromPath)(installDir);
resolvedPyPyVersion = utils_1.readExactPyPyVersionFile(installDir); resolvedPyPyVersion = (0, utils_1.readExactPyPyVersionFile)(installDir);
const isPyPyVersionSatisfies = semver.satisfies(resolvedPyPyVersion, pypyVersion); const isPyPyVersionSatisfies = semver.satisfies(resolvedPyPyVersion, pypyVersion);
if (!isPyPyVersionSatisfies) { if (!isPyPyVersionSatisfies) {
installDir = null; installDir = null;
@ -67899,10 +67831,10 @@ function parsePyPyVersion(versionSpec) {
else { else {
pypyVersion = 'x'; pypyVersion = 'x';
} }
if (!utils_1.validateVersion(pythonVersion) || !utils_1.validateVersion(pypyVersion)) { if (!(0, utils_1.validateVersion)(pythonVersion) || !(0, utils_1.validateVersion)(pypyVersion)) {
throw new Error("Invalid 'version' property for PyPy. Both Python version and PyPy versions should satisfy SemVer notation. See README for examples and documentation."); throw new Error("Invalid 'version' property for PyPy. Both Python version and PyPy versions should satisfy SemVer notation. See README for examples and documentation.");
} }
if (!utils_1.validatePythonVersionFormatForPyPy(pythonVersion)) { if (!(0, utils_1.validatePythonVersionFormatForPyPy)(pythonVersion)) {
throw new Error("Invalid format of Python version for PyPy. Python version should be specified in format 'x.y'. See README for examples and documentation."); throw new Error("Invalid format of Python version for PyPy. Python version should be specified in format 'x.y'. See README for examples and documentation.");
} }
return { return {
@ -67928,7 +67860,11 @@ exports.findPyPyInstallDirForWindows = findPyPyInstallDirForWindows;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@ -67945,15 +67881,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.pythonVersionToSemantic = exports.useCpythonVersion = void 0; exports.pythonVersionToSemantic = exports.useCpythonVersion = void 0;
const os = __importStar(__nccwpck_require__(2037)); const os = __importStar(__nccwpck_require__(2037));
@ -67983,16 +67910,14 @@ function binDir(installDir) {
return path.join(installDir, 'bin'); return path.join(installDir, 'bin');
} }
} }
function useCpythonVersion(version, architecture, updateEnvironment, checkLatest, allowPreReleases) { async function useCpythonVersion(version, architecture, updateEnvironment, checkLatest, allowPreReleases) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let manifest = null; let manifest = null;
const desugaredVersionSpec = desugarDevVersion(version); const desugaredVersionSpec = desugarDevVersion(version);
let semanticVersionSpec = pythonVersionToSemantic(desugaredVersionSpec, allowPreReleases); let semanticVersionSpec = pythonVersionToSemantic(desugaredVersionSpec, allowPreReleases);
core.debug(`Semantic version spec of ${version} is ${semanticVersionSpec}`); core.debug(`Semantic version spec of ${version} is ${semanticVersionSpec}`);
if (checkLatest) { if (checkLatest) {
manifest = yield installer.getManifest(); manifest = await installer.getManifest();
const resolvedVersion = (_a = (yield installer.findReleaseFromManifest(semanticVersionSpec, architecture, manifest))) === null || _a === void 0 ? void 0 : _a.version; const resolvedVersion = (await installer.findReleaseFromManifest(semanticVersionSpec, architecture, manifest))?.version;
if (resolvedVersion) { if (resolvedVersion) {
semanticVersionSpec = resolvedVersion; semanticVersionSpec = resolvedVersion;
core.info(`Resolved as '${semanticVersionSpec}'`); core.info(`Resolved as '${semanticVersionSpec}'`);
@ -68004,15 +67929,15 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
let installDir = tc.find('Python', semanticVersionSpec, architecture); let installDir = tc.find('Python', semanticVersionSpec, architecture);
if (!installDir) { if (!installDir) {
core.info(`Version ${semanticVersionSpec} was not found in the local cache`); core.info(`Version ${semanticVersionSpec} was not found in the local cache`);
const foundRelease = yield installer.findReleaseFromManifest(semanticVersionSpec, architecture, manifest); const foundRelease = await installer.findReleaseFromManifest(semanticVersionSpec, architecture, manifest);
if (foundRelease && foundRelease.files && foundRelease.files.length > 0) { if (foundRelease && foundRelease.files && foundRelease.files.length > 0) {
core.info(`Version ${semanticVersionSpec} is available for downloading`); core.info(`Version ${semanticVersionSpec} is available for downloading`);
yield installer.installCpythonFromRelease(foundRelease); await installer.installCpythonFromRelease(foundRelease);
installDir = tc.find('Python', semanticVersionSpec, architecture); installDir = tc.find('Python', semanticVersionSpec, architecture);
} }
} }
if (!installDir) { if (!installDir) {
const osInfo = yield utils_1.getOSInfo(); const osInfo = await (0, utils_1.getOSInfo)();
throw new Error([ throw new Error([
`The version '${version}' with architecture '${architecture}' was not found for ${osInfo `The version '${version}' with architecture '${architecture}' was not found for ${osInfo
? `${osInfo.osName} ${osInfo.osVersion}` ? `${osInfo.osName} ${osInfo.osVersion}`
@ -68061,7 +67986,6 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
core.setOutput('python-version', installed); core.setOutput('python-version', installed);
core.setOutput('python-path', pythonPath); core.setOutput('python-path', pythonPath);
return { impl: 'CPython', version: installed }; return { impl: 'CPython', version: installed };
});
} }
exports.useCpythonVersion = useCpythonVersion; exports.useCpythonVersion = useCpythonVersion;
/** Convert versions like `3.8-dev` to a version like `~3.8.0-0`. */ /** Convert versions like `3.8-dev` to a version like `~3.8.0-0`. */
@ -68103,7 +68027,11 @@ exports.pythonVersionToSemantic = pythonVersionToSemantic;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@ -68120,15 +68048,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) { var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
@ -68143,10 +68062,9 @@ const httpm = __importStar(__nccwpck_require__(9925));
const exec = __importStar(__nccwpck_require__(1514)); const exec = __importStar(__nccwpck_require__(1514));
const fs_1 = __importDefault(__nccwpck_require__(7147)); const fs_1 = __importDefault(__nccwpck_require__(7147));
const utils_1 = __nccwpck_require__(1314); const utils_1 = __nccwpck_require__(1314);
function installPyPy(pypyVersion, pythonVersion, architecture, allowPreReleases, releases) { async function installPyPy(pypyVersion, pythonVersion, architecture, allowPreReleases, releases) {
return __awaiter(this, void 0, void 0, function* () {
let downloadDir; let downloadDir;
releases = releases !== null && releases !== void 0 ? releases : (yield getAvailablePyPyVersions()); releases = releases ?? (await getAvailablePyPyVersions());
if (!releases || releases.length === 0) { if (!releases || releases.length === 0) {
throw new Error('No release was found in PyPy version.json'); throw new Error('No release was found in PyPy version.json');
} }
@ -68166,26 +68084,26 @@ function installPyPy(pypyVersion, pythonVersion, architecture, allowPreReleases,
const downloadUrl = `${foundAsset.download_url}`; const downloadUrl = `${foundAsset.download_url}`;
core.info(`Downloading PyPy from "${downloadUrl}" ...`); core.info(`Downloading PyPy from "${downloadUrl}" ...`);
try { try {
const pypyPath = yield tc.downloadTool(downloadUrl); const pypyPath = await tc.downloadTool(downloadUrl);
core.info('Extracting downloaded archive...'); core.info('Extracting downloaded archive...');
if (utils_1.IS_WINDOWS) { if (utils_1.IS_WINDOWS) {
downloadDir = yield tc.extractZip(pypyPath); downloadDir = await tc.extractZip(pypyPath);
} }
else { else {
downloadDir = yield tc.extractTar(pypyPath, undefined, 'x'); downloadDir = await tc.extractTar(pypyPath, undefined, 'x');
} }
// root folder in archive can have unpredictable name so just take the first folder // root folder in archive can have unpredictable name so just take the first folder
// downloadDir is unique folder under TEMP and can't contain any other folders // downloadDir is unique folder under TEMP and can't contain any other folders
const archiveName = fs_1.default.readdirSync(downloadDir)[0]; const archiveName = fs_1.default.readdirSync(downloadDir)[0];
const toolDir = path.join(downloadDir, archiveName); const toolDir = path.join(downloadDir, archiveName);
let installDir = toolDir; let installDir = toolDir;
if (!utils_1.isNightlyKeyword(resolvedPyPyVersion)) { if (!(0, utils_1.isNightlyKeyword)(resolvedPyPyVersion)) {
installDir = yield tc.cacheDir(toolDir, 'PyPy', resolvedPythonVersion, architecture); installDir = await tc.cacheDir(toolDir, 'PyPy', resolvedPythonVersion, architecture);
} }
utils_1.writeExactPyPyVersionFile(installDir, resolvedPyPyVersion); (0, utils_1.writeExactPyPyVersionFile)(installDir, resolvedPyPyVersion);
const binaryPath = getPyPyBinaryPath(installDir); const binaryPath = getPyPyBinaryPath(installDir);
yield createPyPySymlink(binaryPath, resolvedPythonVersion); await createPyPySymlink(binaryPath, resolvedPythonVersion);
yield installPip(binaryPath); await installPip(binaryPath);
return { installDir, resolvedPythonVersion, resolvedPyPyVersion }; return { installDir, resolvedPythonVersion, resolvedPyPyVersion };
} }
catch (err) { catch (err) {
@ -68204,23 +68122,19 @@ function installPyPy(pypyVersion, pythonVersion, architecture, allowPreReleases,
} }
throw err; throw err;
} }
});
} }
exports.installPyPy = installPyPy; exports.installPyPy = installPyPy;
function getAvailablePyPyVersions() { async function getAvailablePyPyVersions() {
return __awaiter(this, void 0, void 0, function* () {
const url = 'https://downloads.python.org/pypy/versions.json'; const url = 'https://downloads.python.org/pypy/versions.json';
const http = new httpm.HttpClient('tool-cache'); const http = new httpm.HttpClient('tool-cache');
const response = yield http.getJson(url); const response = await http.getJson(url);
if (!response.result) { if (!response.result) {
throw new Error(`Unable to retrieve the list of available PyPy versions from '${url}'`); throw new Error(`Unable to retrieve the list of available PyPy versions from '${url}'`);
} }
return response.result; return response.result;
});
} }
exports.getAvailablePyPyVersions = getAvailablePyPyVersions; exports.getAvailablePyPyVersions = getAvailablePyPyVersions;
function createPyPySymlink(pypyBinaryPath, pythonVersion) { async function createPyPySymlink(pypyBinaryPath, pythonVersion) {
return __awaiter(this, void 0, void 0, function* () {
const version = semver.coerce(pythonVersion); const version = semver.coerce(pythonVersion);
const pythonBinaryPostfix = semver.major(version); const pythonBinaryPostfix = semver.major(version);
const pythonMinor = semver.minor(version); const pythonMinor = semver.minor(version);
@ -68228,24 +68142,21 @@ function createPyPySymlink(pypyBinaryPath, pythonVersion) {
const pypyMajorMinorBinaryPostfix = `${pythonBinaryPostfix}.${pythonMinor}`; const pypyMajorMinorBinaryPostfix = `${pythonBinaryPostfix}.${pythonMinor}`;
const binaryExtension = utils_1.IS_WINDOWS ? '.exe' : ''; const binaryExtension = utils_1.IS_WINDOWS ? '.exe' : '';
core.info('Creating symlinks...'); core.info('Creating symlinks...');
utils_1.createSymlinkInFolder(pypyBinaryPath, `pypy${pypyBinaryPostfix}${binaryExtension}`, `python${pythonBinaryPostfix}${binaryExtension}`, true); (0, utils_1.createSymlinkInFolder)(pypyBinaryPath, `pypy${pypyBinaryPostfix}${binaryExtension}`, `python${pythonBinaryPostfix}${binaryExtension}`, true);
utils_1.createSymlinkInFolder(pypyBinaryPath, `pypy${pypyBinaryPostfix}${binaryExtension}`, `python${binaryExtension}`, true); (0, utils_1.createSymlinkInFolder)(pypyBinaryPath, `pypy${pypyBinaryPostfix}${binaryExtension}`, `python${binaryExtension}`, true);
utils_1.createSymlinkInFolder(pypyBinaryPath, `pypy${pypyBinaryPostfix}${binaryExtension}`, `pypy${pypyMajorMinorBinaryPostfix}${binaryExtension}`, true); (0, utils_1.createSymlinkInFolder)(pypyBinaryPath, `pypy${pypyBinaryPostfix}${binaryExtension}`, `pypy${pypyMajorMinorBinaryPostfix}${binaryExtension}`, true);
});
} }
function installPip(pythonLocation) { async function installPip(pythonLocation) {
return __awaiter(this, void 0, void 0, function* () {
core.info('Installing and updating pip'); core.info('Installing and updating pip');
const pythonBinary = path.join(pythonLocation, 'python'); const pythonBinary = path.join(pythonLocation, 'python');
yield exec.exec(`${pythonBinary} -m ensurepip`); await exec.exec(`${pythonBinary} -m ensurepip`);
yield exec.exec(`${pythonLocation}/python -m pip install --ignore-installed pip`); await exec.exec(`${pythonLocation}/python -m pip install --ignore-installed pip`);
});
} }
function findRelease(releases, pythonVersion, pypyVersion, architecture, includePrerelease) { function findRelease(releases, pythonVersion, pypyVersion, architecture, includePrerelease) {
const options = { includePrerelease: includePrerelease }; const options = { includePrerelease: includePrerelease };
const filterReleases = releases.filter(item => { const filterReleases = releases.filter(item => {
const isPythonVersionSatisfied = semver.satisfies(semver.coerce(item.python_version), pythonVersion); const isPythonVersionSatisfied = semver.satisfies(semver.coerce(item.python_version), pythonVersion);
const isPyPyNightly = utils_1.isNightlyKeyword(pypyVersion) && utils_1.isNightlyKeyword(item.pypy_version); const isPyPyNightly = (0, utils_1.isNightlyKeyword)(pypyVersion) && (0, utils_1.isNightlyKeyword)(item.pypy_version);
const isPyPyVersionSatisfied = isPyPyNightly || const isPyPyVersionSatisfied = isPyPyNightly ||
semver.satisfies(pypyVersionToSemantic(item.pypy_version), pypyVersion, options); semver.satisfies(pypyVersionToSemantic(item.pypy_version), pypyVersion, options);
const isArchPresent = item.files && const isArchPresent = item.files &&
@ -68322,7 +68233,11 @@ function replaceX32toX86(architecture) {
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@ -68339,15 +68254,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.installCpythonFromRelease = exports.getManifest = exports.findReleaseFromManifest = exports.MANIFEST_URL = void 0; exports.installCpythonFromRelease = exports.getManifest = exports.findReleaseFromManifest = exports.MANIFEST_URL = void 0;
const path = __importStar(__nccwpck_require__(1017)); const path = __importStar(__nccwpck_require__(1017));
@ -68361,14 +68267,12 @@ const MANIFEST_REPO_OWNER = 'actions';
const MANIFEST_REPO_NAME = 'python-versions'; const MANIFEST_REPO_NAME = 'python-versions';
const MANIFEST_REPO_BRANCH = 'main'; const MANIFEST_REPO_BRANCH = 'main';
exports.MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`; exports.MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`;
function findReleaseFromManifest(semanticVersionSpec, architecture, manifest) { async function findReleaseFromManifest(semanticVersionSpec, architecture, manifest) {
return __awaiter(this, void 0, void 0, function* () {
if (!manifest) { if (!manifest) {
manifest = yield getManifest(); manifest = await getManifest();
} }
const foundRelease = yield tc.findFromManifest(semanticVersionSpec, false, manifest, architecture); const foundRelease = await tc.findFromManifest(semanticVersionSpec, false, manifest, architecture);
return foundRelease; return foundRelease;
});
} }
exports.findReleaseFromManifest = findReleaseFromManifest; exports.findReleaseFromManifest = findReleaseFromManifest;
function getManifest() { function getManifest() {
@ -68376,11 +68280,13 @@ function getManifest() {
return tc.getManifestFromRepo(MANIFEST_REPO_OWNER, MANIFEST_REPO_NAME, AUTH, MANIFEST_REPO_BRANCH); return tc.getManifestFromRepo(MANIFEST_REPO_OWNER, MANIFEST_REPO_NAME, AUTH, MANIFEST_REPO_BRANCH);
} }
exports.getManifest = getManifest; exports.getManifest = getManifest;
function installPython(workingDirectory) { async function installPython(workingDirectory) {
return __awaiter(this, void 0, void 0, function* () {
const options = { const options = {
cwd: workingDirectory, cwd: workingDirectory,
env: Object.assign(Object.assign({}, process.env), (utils_1.IS_LINUX && { LD_LIBRARY_PATH: path.join(workingDirectory, 'lib') })), env: {
...process.env,
...(utils_1.IS_LINUX && { LD_LIBRARY_PATH: path.join(workingDirectory, 'lib') })
},
silent: true, silent: true,
listeners: { listeners: {
stdout: (data) => { stdout: (data) => {
@ -68392,30 +68298,28 @@ function installPython(workingDirectory) {
} }
}; };
if (utils_1.IS_WINDOWS) { if (utils_1.IS_WINDOWS) {
yield exec.exec('powershell', ['./setup.ps1'], options); await exec.exec('powershell', ['./setup.ps1'], options);
} }
else { else {
yield exec.exec('bash', ['./setup.sh'], options); await exec.exec('bash', ['./setup.sh'], options);
} }
});
} }
function installCpythonFromRelease(release) { async function installCpythonFromRelease(release) {
return __awaiter(this, void 0, void 0, function* () {
const downloadUrl = release.files[0].download_url; const downloadUrl = release.files[0].download_url;
core.info(`Download from "${downloadUrl}"`); core.info(`Download from "${downloadUrl}"`);
let pythonPath = ''; let pythonPath = '';
try { try {
pythonPath = yield tc.downloadTool(downloadUrl, undefined, AUTH); pythonPath = await tc.downloadTool(downloadUrl, undefined, AUTH);
core.info('Extract downloaded archive'); core.info('Extract downloaded archive');
let pythonExtractedFolder; let pythonExtractedFolder;
if (utils_1.IS_WINDOWS) { if (utils_1.IS_WINDOWS) {
pythonExtractedFolder = yield tc.extractZip(pythonPath); pythonExtractedFolder = await tc.extractZip(pythonPath);
} }
else { else {
pythonExtractedFolder = yield tc.extractTar(pythonPath); pythonExtractedFolder = await tc.extractTar(pythonPath);
} }
core.info('Execute installation script'); core.info('Execute installation script');
yield installPython(pythonExtractedFolder); await installPython(pythonExtractedFolder);
} }
catch (err) { catch (err) {
if (err instanceof tc.HTTPError) { if (err instanceof tc.HTTPError) {
@ -68432,7 +68336,6 @@ function installCpythonFromRelease(release) {
} }
throw err; throw err;
} }
});
} }
exports.installCpythonFromRelease = installCpythonFromRelease; exports.installCpythonFromRelease = installCpythonFromRelease;
@ -68446,7 +68349,11 @@ exports.installCpythonFromRelease = installCpythonFromRelease;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@ -68463,15 +68370,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) { var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
@ -68487,12 +68385,10 @@ const utils_1 = __nccwpck_require__(1314);
function isPyPyVersion(versionSpec) { function isPyPyVersion(versionSpec) {
return versionSpec.startsWith('pypy'); return versionSpec.startsWith('pypy');
} }
function cacheDependencies(cache, pythonVersion) { async function cacheDependencies(cache, pythonVersion) {
return __awaiter(this, void 0, void 0, function* () {
const cacheDependencyPath = core.getInput('cache-dependency-path') || undefined; const cacheDependencyPath = core.getInput('cache-dependency-path') || undefined;
const cacheDistributor = cache_factory_1.getCacheDistributor(cache, pythonVersion, cacheDependencyPath); const cacheDistributor = (0, cache_factory_1.getCacheDistributor)(cache, pythonVersion, cacheDependencyPath);
yield cacheDistributor.restoreCache(); await cacheDistributor.restoreCache();
});
} }
function resolveVersionInput() { function resolveVersionInput() {
const versions = core.getMultilineInput('python-version'); const versions = core.getMultilineInput('python-version');
@ -68511,23 +68407,21 @@ function resolveVersionInput() {
core.info(`Resolved ${versionFile} as ${version}`); core.info(`Resolved ${versionFile} as ${version}`);
return [version]; return [version];
} }
utils_1.logWarning("Neither 'python-version' nor 'python-version-file' inputs were supplied. Attempting to find '.python-version' file."); (0, utils_1.logWarning)("Neither 'python-version' nor 'python-version-file' inputs were supplied. Attempting to find '.python-version' file.");
versionFile = '.python-version'; versionFile = '.python-version';
if (fs_1.default.existsSync(versionFile)) { if (fs_1.default.existsSync(versionFile)) {
const version = fs_1.default.readFileSync(versionFile, 'utf8'); const version = fs_1.default.readFileSync(versionFile, 'utf8');
core.info(`Resolved ${versionFile} as ${version}`); core.info(`Resolved ${versionFile} as ${version}`);
return [version]; return [version];
} }
utils_1.logWarning(`${versionFile} doesn't exist.`); (0, utils_1.logWarning)(`${versionFile} doesn't exist.`);
return versions; return versions;
} }
function run() { async function run() {
var _a;
return __awaiter(this, void 0, void 0, function* () {
if (utils_1.IS_MAC) { if (utils_1.IS_MAC) {
process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache'; process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache';
} }
if ((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim()) { if (process.env.AGENT_TOOLSDIRECTORY?.trim()) {
process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
} }
core.debug(`Python is expected to be installed into ${process.env['RUNNER_TOOL_CACHE']}`); core.debug(`Python is expected to be installed into ${process.env['RUNNER_TOOL_CACHE']}`);
@ -68542,20 +68436,20 @@ function run() {
core.startGroup('Installed versions'); core.startGroup('Installed versions');
for (const version of versions) { for (const version of versions) {
if (isPyPyVersion(version)) { if (isPyPyVersion(version)) {
const installed = yield finderPyPy.findPyPyVersion(version, arch, updateEnvironment, checkLatest, allowPreReleases); const installed = await finderPyPy.findPyPyVersion(version, arch, updateEnvironment, checkLatest, allowPreReleases);
pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}`; pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}`;
core.info(`Successfully set up PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`); core.info(`Successfully set up PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`);
} }
else { else {
const installed = yield finder.useCpythonVersion(version, arch, updateEnvironment, checkLatest, allowPreReleases); const installed = await finder.useCpythonVersion(version, arch, updateEnvironment, checkLatest, allowPreReleases);
pythonVersion = installed.version; pythonVersion = installed.version;
core.info(`Successfully set up ${installed.impl} (${pythonVersion})`); core.info(`Successfully set up ${installed.impl} (${pythonVersion})`);
} }
} }
core.endGroup(); core.endGroup();
const cache = core.getInput('cache'); const cache = core.getInput('cache');
if (cache && utils_1.isCacheFeatureAvailable()) { if (cache && (0, utils_1.isCacheFeatureAvailable)()) {
yield cacheDependencies(cache, pythonVersion); await cacheDependencies(cache, pythonVersion);
} }
} }
else { else {
@ -68567,7 +68461,6 @@ function run() {
catch (err) { catch (err) {
core.setFailed(err.message); core.setFailed(err.message);
} }
});
} }
run(); run();
@ -68581,7 +68474,11 @@ run();
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@ -68598,15 +68495,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) { var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
@ -68707,47 +68595,40 @@ function logWarning(message) {
core.info(`${warningPrefix}${message}`); core.info(`${warningPrefix}${message}`);
} }
exports.logWarning = logWarning; exports.logWarning = logWarning;
function getWindowsInfo() { async function getWindowsInfo() {
return __awaiter(this, void 0, void 0, function* () { const { stdout } = await exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', undefined, {
const { stdout } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', undefined, {
silent: true silent: true
}); });
const windowsVersion = stdout.trim().split(' ')[3]; const windowsVersion = stdout.trim().split(' ')[3];
return { osName: 'Windows', osVersion: windowsVersion }; return { osName: 'Windows', osVersion: windowsVersion };
});
} }
function getMacOSInfo() { async function getMacOSInfo() {
return __awaiter(this, void 0, void 0, function* () { const { stdout } = await exec.getExecOutput('sw_vers', ['-productVersion'], {
const { stdout } = yield exec.getExecOutput('sw_vers', ['-productVersion'], {
silent: true silent: true
}); });
const macOSVersion = stdout.trim(); const macOSVersion = stdout.trim();
return { osName: 'macOS', osVersion: macOSVersion }; return { osName: 'macOS', osVersion: macOSVersion };
});
} }
function getLinuxInfo() { async function getLinuxInfo() {
return __awaiter(this, void 0, void 0, function* () { const { stdout } = await exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {
const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {
silent: true silent: true
}); });
const [osName, osVersion] = stdout.trim().split('\n'); const [osName, osVersion] = stdout.trim().split('\n');
core.debug(`OS Name: ${osName}, Version: ${osVersion}`); core.debug(`OS Name: ${osName}, Version: ${osVersion}`);
return { osName: osName, osVersion: osVersion }; return { osName: osName, osVersion: osVersion };
});
} }
exports.getLinuxInfo = getLinuxInfo; exports.getLinuxInfo = getLinuxInfo;
function getOSInfo() { async function getOSInfo() {
return __awaiter(this, void 0, void 0, function* () {
let osInfo; let osInfo;
try { try {
if (exports.IS_WINDOWS) { if (exports.IS_WINDOWS) {
osInfo = yield getWindowsInfo(); osInfo = await getWindowsInfo();
} }
else if (exports.IS_LINUX) { else if (exports.IS_LINUX) {
osInfo = yield getLinuxInfo(); osInfo = await getLinuxInfo();
} }
else if (exports.IS_MAC) { else if (exports.IS_MAC) {
osInfo = yield getMacOSInfo(); osInfo = await getMacOSInfo();
} }
} }
catch (err) { catch (err) {
@ -68757,7 +68638,6 @@ function getOSInfo() {
finally { finally {
return osInfo; return osInfo;
} }
});
} }
exports.getOSInfo = getOSInfo; exports.getOSInfo = getOSInfo;

41
package-lock.json generated
View file

@ -18,12 +18,13 @@
"semver": "^7.1.3" "semver": "^7.1.3"
}, },
"devDependencies": { "devDependencies": {
"@tsconfig/node16": "1.0.3",
"@types/jest": "^27.0.2", "@types/jest": "^27.0.2",
"@types/node": "^16.11.25", "@types/node": "^16.11.25",
"@types/semver": "^7.1.0", "@types/semver": "^7.1.0",
"@typescript-eslint/eslint-plugin": "^5.54.0", "@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0", "@typescript-eslint/parser": "^5.54.0",
"@vercel/ncc": "^0.33.4", "@vercel/ncc": "^0.36.1",
"eslint": "^8.35.0", "eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-plugin-jest": "^27.2.1", "eslint-plugin-jest": "^27.2.1",
@ -32,7 +33,7 @@
"jest-circus": "^27.2.5", "jest-circus": "^27.2.5",
"prettier": "^2.8.4", "prettier": "^2.8.4",
"ts-jest": "^27.0.5", "ts-jest": "^27.0.5",
"typescript": "^4.2.3" "typescript": "^4.9.5"
} }
}, },
"node_modules/@actions/cache": { "node_modules/@actions/cache": {
@ -2382,6 +2383,12 @@
"node": ">= 6" "node": ">= 6"
} }
}, },
"node_modules/@tsconfig/node16": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz",
"integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==",
"dev": true
},
"node_modules/@types/babel__core": { "node_modules/@types/babel__core": {
"version": "7.1.16", "version": "7.1.16",
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.16.tgz", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.16.tgz",
@ -2722,9 +2729,9 @@
} }
}, },
"node_modules/@vercel/ncc": { "node_modules/@vercel/ncc": {
"version": "0.33.4", "version": "0.36.1",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.33.4.tgz", "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.1.tgz",
"integrity": "sha512-ln18hs7dMffelP47tpkaR+V5Tj6coykNyxJrlcmCormPqRQjB/Gv4cu2FfBG+PMzIfdZp2CLDsrrB1NPU22Qhg==", "integrity": "sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw==",
"dev": true, "dev": true,
"bin": { "bin": {
"ncc": "dist/ncc/cli.js" "ncc": "dist/ncc/cli.js"
@ -6498,9 +6505,9 @@
} }
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "4.2.3", "version": "4.9.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
"integrity": "sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==", "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
"dev": true, "dev": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
@ -8686,6 +8693,12 @@
"integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==",
"dev": true "dev": true
}, },
"@tsconfig/node16": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz",
"integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==",
"dev": true
},
"@types/babel__core": { "@types/babel__core": {
"version": "7.1.16", "version": "7.1.16",
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.16.tgz", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.16.tgz",
@ -8937,9 +8950,9 @@
} }
}, },
"@vercel/ncc": { "@vercel/ncc": {
"version": "0.33.4", "version": "0.36.1",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.33.4.tgz", "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.1.tgz",
"integrity": "sha512-ln18hs7dMffelP47tpkaR+V5Tj6coykNyxJrlcmCormPqRQjB/Gv4cu2FfBG+PMzIfdZp2CLDsrrB1NPU22Qhg==", "integrity": "sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw==",
"dev": true "dev": true
}, },
"abab": { "abab": {
@ -11745,9 +11758,9 @@
} }
}, },
"typescript": { "typescript": {
"version": "4.2.3", "version": "4.9.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
"integrity": "sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==", "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
"dev": true "dev": true
}, },
"universalify": { "universalify": {

View file

@ -34,12 +34,13 @@
"semver": "^7.1.3" "semver": "^7.1.3"
}, },
"devDependencies": { "devDependencies": {
"@tsconfig/node16": "1.0.3",
"@types/jest": "^27.0.2", "@types/jest": "^27.0.2",
"@types/node": "^16.11.25", "@types/node": "^16.11.25",
"@types/semver": "^7.1.0", "@types/semver": "^7.1.0",
"@typescript-eslint/eslint-plugin": "^5.54.0", "@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0", "@typescript-eslint/parser": "^5.54.0",
"@vercel/ncc": "^0.33.4", "@vercel/ncc": "^0.36.1",
"eslint": "^8.35.0", "eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-plugin-jest": "^27.2.1", "eslint-plugin-jest": "^27.2.1",
@ -48,7 +49,7 @@
"jest-circus": "^27.2.5", "jest-circus": "^27.2.5",
"prettier": "^2.8.4", "prettier": "^2.8.4",
"ts-jest": "^27.0.5", "ts-jest": "^27.0.5",
"typescript": "^4.2.3" "typescript": "^4.9.5"
}, },
"husky": { "husky": {
"skipCI": true, "skipCI": true,

View file

@ -1,64 +1,12 @@
{ {
"extends": "@tsconfig/node16/tsconfig.json",
"compilerOptions": { "compilerOptions": {
/* Basic Options */ "outDir": "./lib",
// "incremental": true, /* Enable incremental compilation */ "rootDir": "./src",
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ "resolveJsonModule": true,
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./lib", /* Redirect output structure to the directory. */
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
/* Strict Type-Checking Options */
"strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
/* Additional Checks */
// "noUnusedLocals": true, /* Report errors on unused locals. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"resolveJsonModule": true, /* Allows importing modules with a '.json' extension, which is a common practice in node projects. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
/* Source Map Options */
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
/* Experimental Options */
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
}, },
"exclude": ["node_modules", "**/*.test.ts"] "exclude": [
"node_modules",
"**/*.test.ts"
]
} }