mirror of
https://github.com/actions/setup-python.git
synced 2025-04-24 07:22:14 +00:00
Remove pyproject.toml from default values
This commit is contained in:
parent
6f8266d242
commit
556ac3e0ad
3 changed files with 5 additions and 100 deletions
96
.github/workflows/test-python.yml
vendored
96
.github/workflows/test-python.yml
vendored
|
@ -200,54 +200,6 @@ jobs:
|
||||||
- name: Run simple code
|
- name: Run simple code
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
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:
|
setup-versions-from-poetry-pyproject-file:
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} poetry pyproject file
|
name: Setup ${{ matrix.python }} ${{ matrix.os }} poetry pyproject file
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -298,54 +250,6 @@ jobs:
|
||||||
- name: Run simple code
|
- name: Run simple code
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
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:
|
setup-pre-release-version-from-manifest:
|
||||||
name: Setup 3.9.0-beta.4 ${{ matrix.os }}
|
name: Setup 3.9.0-beta.4 ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
5
dist/setup/index.js
vendored
5
dist/setup/index.js
vendored
|
@ -69700,7 +69700,6 @@ function cacheDependencies(cache, pythonVersion) {
|
||||||
function resolveVersionInputFromDefaultFile() {
|
function resolveVersionInputFromDefaultFile() {
|
||||||
const couples = [
|
const couples = [
|
||||||
['.python-version', utils_1.getVersionInputFromPlainFile],
|
['.python-version', utils_1.getVersionInputFromPlainFile],
|
||||||
['pyproject.toml', utils_1.getVersionInputFromTomlFile]
|
|
||||||
];
|
];
|
||||||
for (const [versionFile, _fn] of couples) {
|
for (const [versionFile, _fn] of couples) {
|
||||||
utils_1.logWarning(`Neither 'python-version' nor 'python-version-file' inputs were supplied. Attempting to find '${versionFile}' file.`);
|
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;
|
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) {
|
function extractValue(obj, keys) {
|
||||||
if (keys.length > 0) {
|
if (keys.length > 0) {
|
||||||
const value = obj[keys[0]];
|
const value = obj[keys[0]];
|
||||||
|
|
|
@ -10,8 +10,7 @@ import {
|
||||||
logWarning,
|
logWarning,
|
||||||
IS_MAC,
|
IS_MAC,
|
||||||
getVersionInputFromFile,
|
getVersionInputFromFile,
|
||||||
getVersionInputFromPlainFile,
|
getVersionInputFromPlainFile
|
||||||
getVersionInputFromTomlFile
|
|
||||||
} from './utils';
|
} from './utils';
|
||||||
|
|
||||||
function isPyPyVersion(versionSpec: string) {
|
function isPyPyVersion(versionSpec: string) {
|
||||||
|
@ -32,7 +31,6 @@ async function cacheDependencies(cache: string, pythonVersion: string) {
|
||||||
function resolveVersionInputFromDefaultFile(): string[] {
|
function resolveVersionInputFromDefaultFile(): string[] {
|
||||||
const couples: [string, (versionFile: string) => string[]][] = [
|
const couples: [string, (versionFile: string) => string[]][] = [
|
||||||
['.python-version', getVersionInputFromPlainFile],
|
['.python-version', getVersionInputFromPlainFile],
|
||||||
['pyproject.toml', getVersionInputFromTomlFile]
|
|
||||||
];
|
];
|
||||||
for (const [versionFile, _fn] of couples) {
|
for (const [versionFile, _fn] of couples) {
|
||||||
logWarning(
|
logWarning(
|
||||||
|
|
Loading…
Add table
Reference in a new issue