Skip to content

Commit

Permalink
Remove pyproject.toml from default values
Browse files Browse the repository at this point in the history
  • Loading branch information
dariocurr committed Jun 27, 2023
1 parent 6f8266d commit 556ac3e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 100 deletions.
96 changes: 0 additions & 96 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
5 changes: 4 additions & 1 deletion dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.`);
Expand Down Expand Up @@ -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]];
Expand Down
4 changes: 1 addition & 3 deletions src/setup-python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import {
logWarning,
IS_MAC,
getVersionInputFromFile,
getVersionInputFromPlainFile,
getVersionInputFromTomlFile
getVersionInputFromPlainFile
} from './utils';

function isPyPyVersion(versionSpec: string) {
Expand All @@ -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(
Expand Down

0 comments on commit 556ac3e

Please sign in to comment.