Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(poetry): normalize package name #19807

Merged
merged 12 commits into from
Jan 14, 2023
8 changes: 5 additions & 3 deletions lib/modules/manager/poetry/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ function extractFromSection(
continue;
}

let pep503NormalizeRegex = /[-_.]+/g;
dave-powell-kensho marked this conversation as resolved.
Show resolved Hide resolved
let depNameNormalized = str.replace(pep503NormalizeRegex, "-");
let skipReason: SkipReason | null = null;
let currentValue = sectionContent[depName];
let nestedVersion = false;
Expand All @@ -79,14 +81,14 @@ function extractFromSection(
}
}
const dep: PackageDependency = {
depName,
depName: depNameNormalized,
dave-powell-kensho marked this conversation as resolved.
Show resolved Hide resolved
depType,
currentValue,
managerData: { nestedVersion },
datasource: PypiDatasource.id,
};
if (depName in poetryLockfile) {
dep.lockedVersion = poetryLockfile[depName];
if (depNameNormalized in poetryLockfile) {
dep.lockedVersion = poetryLockfile[depNameNormalized];
}
if (skipReason) {
dep.skipReason = skipReason;
Expand Down