From c4ab19b63a2a7f1f5449c385292e7ce0b8010530 Mon Sep 17 00:00:00 2001 From: Dario Curreri Date: Wed, 28 Jun 2023 15:23:50 +0200 Subject: [PATCH] Allow python version bounds just with TOMLs --- .github/workflows/e2e-tests.yml | 7 ------- dist/setup/index.js | 5 ++--- src/setup-python.ts | 3 +-- src/utils.ts | 2 +- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 5672b26f..5c16b95c 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -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 diff --git a/dist/setup/index.js b/dist/setup/index.js index 178a4389..68dbef8b 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -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; /** diff --git a/src/setup-python.ts b/src/setup-python.ts index ccebc464..5c1bce4c 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -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; } diff --git a/src/utils.ts b/src/utils.ts index 52bc0bc3..552f5895 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -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(' ')); } /**