mirror of
https://github.com/actions/setup-python
synced 2024-11-30 21:22:28 +08:00
Merge 42afbeef7f
into 19dfb7b659
This commit is contained in:
commit
eb39511f75
17
dist/setup/index.js
vendored
17
dist/setup/index.js
vendored
@ -91086,13 +91086,9 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
|
|||||||
core.exportVariable('Python3_ROOT_DIR', installDir);
|
core.exportVariable('Python3_ROOT_DIR', installDir);
|
||||||
core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig');
|
core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig');
|
||||||
if (utils_1.IS_LINUX) {
|
if (utils_1.IS_LINUX) {
|
||||||
const libPath = process.env.LD_LIBRARY_PATH
|
|
||||||
? `:${process.env.LD_LIBRARY_PATH}`
|
|
||||||
: '';
|
|
||||||
const pyLibPath = path.join(installDir, 'lib');
|
const pyLibPath = path.join(installDir, 'lib');
|
||||||
if (!libPath.split(':').includes(pyLibPath)) {
|
ensurePathInEnvVar('LIBRARY_PATH', pyLibPath);
|
||||||
core.exportVariable('LD_LIBRARY_PATH', pyLibPath + libPath);
|
ensurePathInEnvVar('LD_LIBRARY_PATH', pyLibPath);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
core.addPath(installDir);
|
core.addPath(installDir);
|
||||||
core.addPath(_binDir);
|
core.addPath(_binDir);
|
||||||
@ -91115,6 +91111,15 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.useCpythonVersion = useCpythonVersion;
|
exports.useCpythonVersion = useCpythonVersion;
|
||||||
|
/** Ensure a folder is present in a colon-separated env-var */
|
||||||
|
function ensurePathInEnvVar(envVarName, extraPath) {
|
||||||
|
const currentPath = process.env[envVarName]
|
||||||
|
? `:${process.env[envVarName]}`
|
||||||
|
: '';
|
||||||
|
if (!currentPath.split(':').includes(extraPath)) {
|
||||||
|
core.exportVariable(envVarName, extraPath + currentPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
/** 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`. */
|
||||||
function desugarDevVersion(versionSpec) {
|
function desugarDevVersion(versionSpec) {
|
||||||
const devVersion = /^(\d+)\.(\d+)-dev$/;
|
const devVersion = /^(\d+)\.(\d+)-dev$/;
|
||||||
|
@ -121,15 +121,11 @@ export async function useCpythonVersion(
|
|||||||
core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig');
|
core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig');
|
||||||
|
|
||||||
if (IS_LINUX) {
|
if (IS_LINUX) {
|
||||||
const libPath = process.env.LD_LIBRARY_PATH
|
|
||||||
? `:${process.env.LD_LIBRARY_PATH}`
|
|
||||||
: '';
|
|
||||||
const pyLibPath = path.join(installDir, 'lib');
|
const pyLibPath = path.join(installDir, 'lib');
|
||||||
|
ensurePathInEnvVar('LIBRARY_PATH', pyLibPath);
|
||||||
|
ensurePathInEnvVar('LD_LIBRARY_PATH', pyLibPath);
|
||||||
|
}
|
||||||
|
|
||||||
if (!libPath.split(':').includes(pyLibPath)) {
|
|
||||||
core.exportVariable('LD_LIBRARY_PATH', pyLibPath + libPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
core.addPath(installDir);
|
core.addPath(installDir);
|
||||||
core.addPath(_binDir);
|
core.addPath(_binDir);
|
||||||
|
|
||||||
@ -159,6 +155,17 @@ export async function useCpythonVersion(
|
|||||||
return {impl: 'CPython', version: installed};
|
return {impl: 'CPython', version: installed};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Ensure a folder is present in a colon-separated env-var */
|
||||||
|
function ensurePathInEnvVar(envVarName: string, extraPath: string) {
|
||||||
|
const currentPath = process.env[envVarName]
|
||||||
|
? `:${process.env[envVarName]}`
|
||||||
|
: '';
|
||||||
|
|
||||||
|
if (!currentPath.split(':').includes(extraPath)) {
|
||||||
|
core.exportVariable(envVarName, extraPath + currentPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 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`. */
|
||||||
function desugarDevVersion(versionSpec: string) {
|
function desugarDevVersion(versionSpec: string) {
|
||||||
const devVersion = /^(\d+)\.(\d+)-dev$/;
|
const devVersion = /^(\d+)\.(\d+)-dev$/;
|
||||||
|
Loading…
Reference in New Issue
Block a user