Skip to content

Commit

Permalink
chore(manager/poetry): log determined poetry version (#29028)
Browse files Browse the repository at this point in the history
  • Loading branch information
fgreinacher committed May 13, 2024
1 parent 4c6d03e commit 33eb4fd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/modules/manager/poetry/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,21 @@ export function getPoetryRequirement(
const firstLine = existingLockFileContent.split('\n')[0];
const poetryVersionMatch = firstLine.match(/by Poetry ([\d\\.]+)/);
if (poetryVersionMatch?.[1]) {
logger.debug('Using poetry version from poetry.lock header');
return poetryVersionMatch[1];
const poetryVersion = poetryVersionMatch[1];
logger.debug(
`Using poetry version ${poetryVersion} from poetry.lock header`,
);
return poetryVersion;
}

const { val: lockfilePoetryConstraint } = Result.parse(
existingLockFileContent,
Lockfile.transform(({ poetryConstraint }) => poetryConstraint),
).unwrap();
if (lockfilePoetryConstraint) {
logger.debug('Using poetry version from poetry.lock metadata');
logger.debug(
`Using poetry version ${lockfilePoetryConstraint} from poetry.lock metadata`,
);
return lockfilePoetryConstraint;
}

Expand All @@ -78,7 +83,9 @@ export function getPoetryRequirement(
PoetrySchemaToml.transform(({ poetryRequirement }) => poetryRequirement),
).unwrap();
if (pyprojectPoetryConstraint) {
logger.debug('Using poetry version from pyproject.toml');
logger.debug(
`Using poetry version ${pyprojectPoetryConstraint} from pyproject.toml`,
);
return pyprojectPoetryConstraint;
}

Expand Down

0 comments on commit 33eb4fd

Please sign in to comment.