This commit is contained in:
Nicolas Delaby 2026-01-01 17:36:21 -08:00 committed by GitHub
commit cd689fed04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 5 deletions

View file

@ -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}`);