mirror of
https://github.com/actions/setup-python.git
synced 2026-01-20 04:38:56 +08:00
Merge 2eb6c43547 into 4f41a90a1f
This commit is contained in:
commit
cd689fed04
2 changed files with 25 additions and 5 deletions
18
src/utils.ts
18
src/utils.ts
|
|
@ -239,15 +239,23 @@ export function getVersionInputFromTomlFile(versionFile: string): string[] {
|
|||
|
||||
if ('project' in pyprojectConfig) {
|
||||
// standard project metadata (PEP 621)
|
||||
keys = ['project', 'requires-python'];
|
||||
keys = [['project', 'requires-python']];
|
||||
} else {
|
||||
// python poetry
|
||||
keys = ['tool', 'poetry', 'dependencies', 'python'];
|
||||
keys = [
|
||||
// implicit group main
|
||||
['tool', 'poetry', 'dependencies', 'python'],
|
||||
// explicit group main
|
||||
['tool', 'poetry', 'group', 'main', 'dependencies', 'python']
|
||||
];
|
||||
}
|
||||
const versions = [];
|
||||
const version = extractValue(pyprojectConfig, keys);
|
||||
if (version !== undefined) {
|
||||
versions.push(version);
|
||||
for (const key of keys) {
|
||||
const version = extractValue(pyprojectConfig, key);
|
||||
if (version !== undefined) {
|
||||
versions.push(version);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
core.info(`Extracted ${versions} from ${versionFile}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue