Skip to content

Commit

Permalink
fix: version resolution when only version file is present
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <me@frostming.com>
  • Loading branch information
frostming committed Jan 25, 2024
1 parent 1a0fea8 commit d4d1a77
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ author: Frost Ming
inputs:
python-version:
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:
description: 'File containing the Python version to use. Example: .python-version'
architecture:
Expand Down
2 changes: 1 addition & 1 deletion dist/setup-pdm.js
Original file line number Diff line number Diff line change
Expand Up @@ -91003,7 +91003,7 @@ function isCacheAvailable() {
}
function resolveVersionInputFromDefaultFile() {
const couples = [
[".python-version", getVersionInputFromPlainFile]
["pyproject.toml", getVersionInputFromTomlFile]
];
for (const [versionFile, _fn] of couples) {
logWarning(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-pdm",
"version": "2.0.0",
"version": "4.0.0",
"packageManager": "pnpm@8.14.3",
"description": "The GitHub Action for using pdm as the package manager",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useCpythonVersion } from 'setup-python/src/find-python'
import { findPyPyVersion } from 'setup-python/src/find-pypy'
import {
getVersionInputFromFile,
getVersionInputFromPlainFile,
getVersionInputFromTomlFile,
logWarning,
} from 'setup-python/src/utils'
import { getExecOutput } from '@actions/exec'
Expand Down Expand Up @@ -80,7 +80,7 @@ export function isCacheAvailable(): boolean {

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 d4d1a77

Please sign in to comment.