mirror of
https://github.com/actions/setup-python.git
synced 2026-01-20 04:38:56 +08:00
Get rid of stable boolean input
This commit is contained in:
parent
d025544791
commit
d6f2ec53d6
8 changed files with 48 additions and 30 deletions
|
|
@ -71,8 +71,7 @@ function usePyPy(majorVersion: 2 | 3, architecture: string): InstalledVersion {
|
|||
|
||||
async function useCpythonVersion(
|
||||
version: string,
|
||||
architecture: string,
|
||||
stable: boolean
|
||||
architecture: string
|
||||
): Promise<InstalledVersion> {
|
||||
const desugaredVersionSpec = desugarDevVersion(version);
|
||||
const semanticVersionSpec = pythonVersionToSemantic(desugaredVersionSpec);
|
||||
|
|
@ -89,8 +88,7 @@ async function useCpythonVersion(
|
|||
);
|
||||
const foundRelease = await installer.findReleaseFromManifest(
|
||||
semanticVersionSpec,
|
||||
architecture,
|
||||
stable
|
||||
architecture
|
||||
);
|
||||
|
||||
if (foundRelease && foundRelease.files && foundRelease.files.length > 0) {
|
||||
|
|
@ -173,8 +171,7 @@ export function pythonVersionToSemantic(versionSpec: string) {
|
|||
|
||||
export async function findPythonVersion(
|
||||
version: string,
|
||||
architecture: string,
|
||||
stable: boolean
|
||||
architecture: string
|
||||
): Promise<InstalledVersion> {
|
||||
switch (version.toUpperCase()) {
|
||||
case 'PYPY2':
|
||||
|
|
@ -182,6 +179,6 @@ export async function findPythonVersion(
|
|||
case 'PYPY3':
|
||||
return usePyPy(3, architecture);
|
||||
default:
|
||||
return await useCpythonVersion(version, architecture, stable);
|
||||
return await useCpythonVersion(version, architecture);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ const IS_WINDOWS = process.platform === 'win32';
|
|||
|
||||
export async function findReleaseFromManifest(
|
||||
semanticVersionSpec: string,
|
||||
architecture: string,
|
||||
stable: boolean
|
||||
architecture: string
|
||||
): Promise<tc.IToolRelease | undefined> {
|
||||
const manifest: tc.IToolRelease[] = await tc.getManifestFromRepo(
|
||||
MANIFEST_REPO_OWNER,
|
||||
|
|
@ -26,7 +25,7 @@ export async function findReleaseFromManifest(
|
|||
);
|
||||
return await tc.findFromManifest(
|
||||
semanticVersionSpec,
|
||||
stable,
|
||||
false,
|
||||
manifest,
|
||||
architecture
|
||||
);
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@ async function run() {
|
|||
let version = core.getInput('python-version');
|
||||
if (version) {
|
||||
const arch: string = core.getInput('architecture') || os.arch();
|
||||
let stable = (core.getInput('stable') || 'true').toUpperCase() === 'TRUE';
|
||||
const installed = await finder.findPythonVersion(version, arch, stable);
|
||||
const installed = await finder.findPythonVersion(version, arch);
|
||||
core.info(`Successfully setup ${installed.impl} (${installed.version})`);
|
||||
}
|
||||
const matchersPath = path.join(__dirname, '..', '.github');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue