fix: version resolution when only version file is present
Signed-off-by: Frost Ming <me@frostming.com>
This commit is contained in:
parent
1a0fea8b8e
commit
d4d1a77594
@ -5,8 +5,6 @@ author: Frost Ming
|
|||||||
inputs:
|
inputs:
|
||||||
python-version:
|
python-version:
|
||||||
description: 'Version range or exact version of a Python version to use, using SemVer''s version range syntax.'
|
description: 'Version range or exact version of a Python version to use, using SemVer''s version range syntax.'
|
||||||
default: 3.x
|
|
||||||
required: false
|
|
||||||
python-version-file:
|
python-version-file:
|
||||||
description: 'File containing the Python version to use. Example: .python-version'
|
description: 'File containing the Python version to use. Example: .python-version'
|
||||||
architecture:
|
architecture:
|
||||||
|
2
dist/setup-pdm.js
vendored
2
dist/setup-pdm.js
vendored
@ -91003,7 +91003,7 @@ function isCacheAvailable() {
|
|||||||
}
|
}
|
||||||
function resolveVersionInputFromDefaultFile() {
|
function resolveVersionInputFromDefaultFile() {
|
||||||
const couples = [
|
const couples = [
|
||||||
[".python-version", getVersionInputFromPlainFile]
|
["pyproject.toml", getVersionInputFromTomlFile]
|
||||||
];
|
];
|
||||||
for (const [versionFile, _fn] of couples) {
|
for (const [versionFile, _fn] of couples) {
|
||||||
logWarning(
|
logWarning(
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-pdm",
|
"name": "setup-pdm",
|
||||||
"version": "2.0.0",
|
"version": "4.0.0",
|
||||||
"packageManager": "pnpm@8.14.3",
|
"packageManager": "pnpm@8.14.3",
|
||||||
"description": "The GitHub Action for using pdm as the package manager",
|
"description": "The GitHub Action for using pdm as the package manager",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -7,7 +7,7 @@ import { useCpythonVersion } from 'setup-python/src/find-python'
|
|||||||
import { findPyPyVersion } from 'setup-python/src/find-pypy'
|
import { findPyPyVersion } from 'setup-python/src/find-pypy'
|
||||||
import {
|
import {
|
||||||
getVersionInputFromFile,
|
getVersionInputFromFile,
|
||||||
getVersionInputFromPlainFile,
|
getVersionInputFromTomlFile,
|
||||||
logWarning,
|
logWarning,
|
||||||
} from 'setup-python/src/utils'
|
} from 'setup-python/src/utils'
|
||||||
import { getExecOutput } from '@actions/exec'
|
import { getExecOutput } from '@actions/exec'
|
||||||
@ -80,7 +80,7 @@ export function isCacheAvailable(): boolean {
|
|||||||
|
|
||||||
function resolveVersionInputFromDefaultFile(): string[] {
|
function resolveVersionInputFromDefaultFile(): string[] {
|
||||||
const couples: [string, (versionFile: string) => string[]][] = [
|
const couples: [string, (versionFile: string) => string[]][] = [
|
||||||
['.python-version', getVersionInputFromPlainFile],
|
['pyproject.toml', getVersionInputFromTomlFile],
|
||||||
]
|
]
|
||||||
for (const [versionFile, _fn] of couples) {
|
for (const [versionFile, _fn] of couples) {
|
||||||
logWarning(
|
logWarning(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user