mirror of
https://github.com/actions/setup-python.git
synced 2025-04-24 15:32:13 +00:00
add licenses
This commit is contained in:
parent
7339590dca
commit
381a73b90e
10 changed files with 52 additions and 58 deletions
2
.licenses/npm/@actions/core.dep.yml
generated
2
.licenses/npm/@actions/core.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@actions/core"
|
||||
version: 1.2.6
|
||||
version: 1.7.0
|
||||
type: npm
|
||||
summary: Actions core lib
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/core
|
||||
|
|
32
.licenses/npm/@actions/http-client-1.0.8.dep.yml
generated
32
.licenses/npm/@actions/http-client-1.0.8.dep.yml
generated
|
@ -1,32 +0,0 @@
|
|||
---
|
||||
name: "@actions/http-client"
|
||||
version: 1.0.8
|
||||
type: npm
|
||||
summary: Actions Http Client
|
||||
homepage: https://github.com/actions/http-client#readme
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |
|
||||
Actions Http Client for Node.js
|
||||
|
||||
Copyright (c) GitHub, Inc.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
notices: []
|
|
@ -34,7 +34,7 @@ describe('Finder tests', () => {
|
|||
|
||||
it('Finds Python if it is installed', async () => {
|
||||
const getBooleanInputSpy = jest.spyOn(core, 'getBooleanInput');
|
||||
getBooleanInputSpy.mockImplementation((input) => false);
|
||||
getBooleanInputSpy.mockImplementation(input => false);
|
||||
|
||||
const pythonDir: string = path.join(toolDir, 'Python', '3.0.0', 'x64');
|
||||
await io.mkdirP(pythonDir);
|
||||
|
@ -48,7 +48,7 @@ describe('Finder tests', () => {
|
|||
findSpy.mockImplementation(() => <tc.IToolRelease[]>manifestData);
|
||||
|
||||
const getBooleanInputSpy = jest.spyOn(core, 'getBooleanInput');
|
||||
getBooleanInputSpy.mockImplementation((input) => false);
|
||||
getBooleanInputSpy.mockImplementation(input => false);
|
||||
|
||||
const installSpy: jest.SpyInstance = jest.spyOn(
|
||||
installer,
|
||||
|
@ -68,7 +68,7 @@ describe('Finder tests', () => {
|
|||
findSpy.mockImplementation(() => <tc.IToolRelease[]>manifestData);
|
||||
|
||||
const getBooleanInputSpy = jest.spyOn(core, 'getBooleanInput');
|
||||
getBooleanInputSpy.mockImplementation((input) => false);
|
||||
getBooleanInputSpy.mockImplementation(input => false);
|
||||
|
||||
const installSpy: jest.SpyInstance = jest.spyOn(
|
||||
installer,
|
||||
|
@ -93,7 +93,7 @@ describe('Finder tests', () => {
|
|||
findSpy.mockImplementation(() => <tc.IToolRelease[]>manifestData);
|
||||
|
||||
const getBooleanInputSpy = jest.spyOn(core, 'getBooleanInput');
|
||||
getBooleanInputSpy.mockImplementation((input) => true);
|
||||
getBooleanInputSpy.mockImplementation(input => true);
|
||||
|
||||
const cnSpy: jest.SpyInstance = jest.spyOn(process.stdout, 'write');
|
||||
cnSpy.mockImplementation(line => {
|
||||
|
@ -102,14 +102,10 @@ describe('Finder tests', () => {
|
|||
});
|
||||
|
||||
const infoSpy: jest.SpyInstance = jest.spyOn(core, 'info');
|
||||
infoSpy.mockImplementation(() => {
|
||||
|
||||
});
|
||||
infoSpy.mockImplementation(() => {});
|
||||
|
||||
const debugSpy: jest.SpyInstance = jest.spyOn(core, 'debug');
|
||||
debugSpy.mockImplementation(() => {
|
||||
|
||||
});
|
||||
debugSpy.mockImplementation(() => {});
|
||||
|
||||
const pythonDir: string = path.join(toolDir, 'Python', '1.2.2', 'x64');
|
||||
const expPath: string = path.join(toolDir, 'Python', '1.2.3', 'x64');
|
||||
|
@ -131,7 +127,9 @@ describe('Finder tests', () => {
|
|||
await finder.useCpythonVersion('1.2', 'x64', true);
|
||||
|
||||
expect(infoSpy).toHaveBeenCalledWith("Resolved as '1.2.3'");
|
||||
expect(infoSpy).toHaveBeenCalledWith('Version 1.2.3 was not found in the local cache');
|
||||
expect(infoSpy).toHaveBeenCalledWith(
|
||||
'Version 1.2.3 was not found in the local cache'
|
||||
);
|
||||
expect(cnSpy).toHaveBeenCalledWith(`::add-path::${expPath}${os.EOL}`);
|
||||
});
|
||||
|
||||
|
|
2
dist/setup/index.js
vendored
2
dist/setup/index.js
vendored
|
@ -9752,7 +9752,7 @@ const utils_1 = __webpack_require__(163);
|
|||
function installPyPy(pypyVersion, pythonVersion, architecture, releases) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let downloadDir;
|
||||
releases !== null && releases !== void 0 ? releases : (releases = yield getAvailablePyPyVersions());
|
||||
releases = releases !== null && releases !== void 0 ? releases : (yield getAvailablePyPyVersions());
|
||||
if (!releases || releases.length === 0) {
|
||||
throw new Error('No release was found in PyPy version.json');
|
||||
}
|
||||
|
|
|
@ -42,11 +42,15 @@ export async function findPyPyVersion(
|
|||
);
|
||||
|
||||
if (releaseData) {
|
||||
core.info(`Resolved as PyPy ${releaseData.resolvedPyPyVersion} with Python (${releaseData.resolvedPythonVersion})`);
|
||||
core.info(
|
||||
`Resolved as PyPy ${releaseData.resolvedPyPyVersion} with Python (${releaseData.resolvedPythonVersion})`
|
||||
);
|
||||
pypyVersionSpec.pythonVersion = releaseData.resolvedPythonVersion;
|
||||
pypyVersionSpec.pypyVersion = releaseData.resolvedPyPyVersion;
|
||||
} else {
|
||||
core.info(`Failed to resolve PyPy ${pypyVersionSpec.pypyVersion} with Python (${pypyVersionSpec.pythonVersion}) from manifest`);
|
||||
core.info(
|
||||
`Failed to resolve PyPy ${pypyVersionSpec.pypyVersion} with Python (${pypyVersionSpec.pythonVersion}) from manifest`
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,13 +42,21 @@ export async function useCpythonVersion(
|
|||
|
||||
if (checkLatest) {
|
||||
manifest = await installer.getManifest();
|
||||
const resolvedVersion = (await installer.findReleaseFromManifest(semanticVersionSpec, architecture, manifest))?.version;
|
||||
const resolvedVersion = (
|
||||
await installer.findReleaseFromManifest(
|
||||
semanticVersionSpec,
|
||||
architecture,
|
||||
manifest
|
||||
)
|
||||
)?.version;
|
||||
|
||||
if (resolvedVersion) {
|
||||
semanticVersionSpec = resolvedVersion;
|
||||
core.info(`Resolved as '${semanticVersionSpec}'`);
|
||||
} else {
|
||||
core.info(`Failed to resolve version ${semanticVersionSpec} from manifest`);
|
||||
core.info(
|
||||
`Failed to resolve version ${semanticVersionSpec} from manifest`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,8 @@ export async function installPyPy(
|
|||
) {
|
||||
let downloadDir;
|
||||
|
||||
releases ??= await getAvailablePyPyVersions();
|
||||
releases = releases ?? (await getAvailablePyPyVersions());
|
||||
|
||||
if (!releases || releases.length === 0) {
|
||||
throw new Error('No release was found in PyPy version.json');
|
||||
}
|
||||
|
|
|
@ -32,8 +32,15 @@ export async function findReleaseFromManifest(
|
|||
}
|
||||
|
||||
export function getManifest(): Promise<tc.IToolRelease[]> {
|
||||
core.debug(`Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}`);
|
||||
return tc.getManifestFromRepo(MANIFEST_REPO_OWNER, MANIFEST_REPO_NAME, AUTH, MANIFEST_REPO_BRANCH);
|
||||
core.debug(
|
||||
`Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}`
|
||||
);
|
||||
return tc.getManifestFromRepo(
|
||||
MANIFEST_REPO_OWNER,
|
||||
MANIFEST_REPO_NAME,
|
||||
AUTH,
|
||||
MANIFEST_REPO_BRANCH
|
||||
);
|
||||
}
|
||||
|
||||
async function installPython(workingDirectory: string) {
|
||||
|
|
|
@ -39,13 +39,21 @@ async function run() {
|
|||
let pythonVersion: string;
|
||||
const arch: string = core.getInput('architecture') || os.arch();
|
||||
if (isPyPyVersion(version)) {
|
||||
const installed = await finderPyPy.findPyPyVersion(version, arch, checkLatest);
|
||||
const installed = await finderPyPy.findPyPyVersion(
|
||||
version,
|
||||
arch,
|
||||
checkLatest
|
||||
);
|
||||
pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}`;
|
||||
core.info(
|
||||
`Successfully set up PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`
|
||||
);
|
||||
} else {
|
||||
const installed = await finder.useCpythonVersion(version, arch, checkLatest);
|
||||
const installed = await finder.useCpythonVersion(
|
||||
version,
|
||||
arch,
|
||||
checkLatest
|
||||
);
|
||||
pythonVersion = installed.version;
|
||||
core.info(`Successfully set up ${installed.impl} (${pythonVersion})`);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue