Allow python version bounds just with TOMLs

This commit is contained in:
Dario Curreri 2023-06-28 15:23:50 +02:00
parent 556ac3e0ad
commit c4ab19b63a
No known key found for this signature in database
4 changed files with 4 additions and 13 deletions

View File

@ -107,10 +107,3 @@ jobs:
python-version: '>3.8'
- name: Verify >3.8
run: python __tests__/verify-python.py 3.11
- name: Run with setup-python >=3.8,<3.10
uses: ./
with:
python-version: '>=3.8,<3.10'
- name: Verify >=3.8,<3.10
run: python __tests__/verify-python.py 3.9

5
dist/setup/index.js vendored
View File

@ -69699,7 +69699,7 @@ function cacheDependencies(cache, pythonVersion) {
}
function resolveVersionInputFromDefaultFile() {
const couples = [
['.python-version', utils_1.getVersionInputFromPlainFile],
['.python-version', utils_1.getVersionInputFromPlainFile]
];
for (const [versionFile, _fn] of couples) {
utils_1.logWarning(`Neither 'python-version' nor 'python-version-file' inputs were supplied. Attempting to find '${versionFile}' file.`);
@ -69731,7 +69731,6 @@ function resolveVersionInput() {
versions = resolveVersionInputFromDefaultFile();
}
}
versions = Array.from(versions, version => version.split(',').join(' '));
return versions;
}
function run() {
@ -70019,7 +70018,7 @@ function getVersionInputFromTomlFile(versionFile) {
versions.push(version);
}
core.info(`Extracted ${versions} from ${versionFile}`);
return versions;
return Array.from(versions, version => version.split(',').join(' '));
}
exports.getVersionInputFromTomlFile = getVersionInputFromTomlFile;
/**

View File

@ -30,7 +30,7 @@ async function cacheDependencies(cache: string, pythonVersion: string) {
function resolveVersionInputFromDefaultFile(): string[] {
const couples: [string, (versionFile: string) => string[]][] = [
['.python-version', getVersionInputFromPlainFile],
['.python-version', getVersionInputFromPlainFile]
];
for (const [versionFile, _fn] of couples) {
logWarning(
@ -68,7 +68,6 @@ function resolveVersionInput() {
}
}
versions = Array.from(versions, version => version.split(',').join(' '));
return versions;
}

View File

@ -229,7 +229,7 @@ export function getVersionInputFromTomlFile(versionFile: string): string[] {
}
core.info(`Extracted ${versions} from ${versionFile}`);
return versions;
return Array.from(versions, version => version.split(',').join(' '));
}
/**