diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 39694fbbd..56f84796f 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -200,54 +200,6 @@ jobs: - name: Run simple code run: python -c 'import math; print(math.factorial(5))' - setup-versions-from-standard-pyproject-file-without-parameter: - name: Setup ${{ matrix.python }} ${{ matrix.os }} standard pyproject file without parameter - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04] - python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13] - exclude: - - os: ubuntu-22.04 - python: 3.5.4 - - os: ubuntu-22.04 - python: 3.6.7 - - os: ubuntu-22.04 - python: 3.7.5 - - os: windows-latest - python: 3.8.15 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: build-version-file ${{ matrix.python }} - run: | - echo '[project] - requires-python = "${{ matrix.python }}" - ' > pyproject.toml - - - name: setup-python ${{ matrix.python }} - id: setup-python - uses: ./ - - - name: Check python-path - run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}' - shell: bash - - - name: Validate version - run: | - $pythonVersion = (python --version) - if ("Python ${{ matrix.python }}" -ne "$pythonVersion"){ - Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}" - exit 1 - } - $pythonVersion - shell: pwsh - - - name: Run simple code - run: python -c 'import math; print(math.factorial(5))' - setup-versions-from-poetry-pyproject-file: name: Setup ${{ matrix.python }} ${{ matrix.os }} poetry pyproject file runs-on: ${{ matrix.os }} @@ -298,54 +250,6 @@ jobs: - name: Run simple code run: python -c 'import math; print(math.factorial(5))' - setup-versions-from-poetry-pyproject-file-without-parameter: - name: Setup ${{ matrix.python }} ${{ matrix.os }} poetry pyproject file without parameter - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04] - python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13] - exclude: - - os: ubuntu-22.04 - python: 3.5.4 - - os: ubuntu-22.04 - python: 3.6.7 - - os: ubuntu-22.04 - python: 3.7.5 - - os: windows-latest - python: 3.8.15 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: build-version-file ${{ matrix.python }} - run: | - echo '[tool.poetry.dependencies] - python = "${{ matrix.python }}" - ' > pyproject.toml - - - name: setup-python ${{ matrix.python }} - id: setup-python - uses: ./ - - - name: Check python-path - run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}' - shell: bash - - - name: Validate version - run: | - $pythonVersion = (python --version) - if ("Python ${{ matrix.python }}" -ne "$pythonVersion"){ - Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}" - exit 1 - } - $pythonVersion - shell: pwsh - - - name: Run simple code - run: python -c 'import math; print(math.factorial(5))' - setup-pre-release-version-from-manifest: name: Setup 3.9.0-beta.4 ${{ matrix.os }} runs-on: ${{ matrix.os }} diff --git a/dist/setup/index.js b/dist/setup/index.js index b491ce58e..178a43891 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -69700,7 +69700,6 @@ function cacheDependencies(cache, pythonVersion) { function resolveVersionInputFromDefaultFile() { const couples = [ ['.python-version', utils_1.getVersionInputFromPlainFile], - ['pyproject.toml', utils_1.getVersionInputFromTomlFile] ]; for (const [versionFile, _fn] of couples) { utils_1.logWarning(`Neither 'python-version' nor 'python-version-file' inputs were supplied. Attempting to find '${versionFile}' file.`); @@ -69975,6 +69974,10 @@ function getOSInfo() { }); } exports.getOSInfo = getOSInfo; +/** + * Extract a value from an object by following the keys path provided. + * If the value is present, it is returned. Otherwise undefined is returned. + */ function extractValue(obj, keys) { if (keys.length > 0) { const value = obj[keys[0]]; diff --git a/src/setup-python.ts b/src/setup-python.ts index dc802697b..ccebc464a 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -10,8 +10,7 @@ import { logWarning, IS_MAC, getVersionInputFromFile, - getVersionInputFromPlainFile, - getVersionInputFromTomlFile + getVersionInputFromPlainFile } from './utils'; function isPyPyVersion(versionSpec: string) { @@ -32,7 +31,6 @@ async function cacheDependencies(cache: string, pythonVersion: string) { function resolveVersionInputFromDefaultFile(): string[] { const couples: [string, (versionFile: string) => string[]][] = [ ['.python-version', getVersionInputFromPlainFile], - ['pyproject.toml', getVersionInputFromTomlFile] ]; for (const [versionFile, _fn] of couples) { logWarning(