Skip to content

Commit

Permalink
feat(manager/pep621)!: remove group name from depName (#28193)
Browse files Browse the repository at this point in the history
Previously, the “depName” for pep621 was constructed using groupName/packageName, which in turn meant that the same dependency was upgraded in different branches if it was present in multiple groups. Instead, depName is now set to packageName. This will lead to a change of branch name for pep621 updates.

Closes #28131

BREAKING CHANGE: depName for pep621 dependencies changes, which will lead to branch name changes, which will lead to some autoclosing and reopening of PRs.
  • Loading branch information
secustor authored and rarkins committed May 6, 2024
1 parent 65a7227 commit 1891c08
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions lib/modules/manager/pep621/extract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ describe('modules/manager/pep621/extract', () => {
datasource: 'pypi',
depType: 'project.optional-dependencies',
currentValue: '>12',
depName: 'pytest/pytest',
depName: 'pytest',
},
{
packageName: 'pytest-mock',
datasource: 'pypi',
depType: 'project.optional-dependencies',
skipReason: 'unspecified-version',
depName: 'pytest/pytest-mock',
depName: 'pytest-mock',
},
]);

Expand All @@ -154,28 +154,28 @@ describe('modules/manager/pep621/extract', () => {
datasource: 'pypi',
depType: 'tool.pdm.dev-dependencies',
skipReason: 'unspecified-version',
depName: 'test/pdm',
depName: 'pdm',
},
{
packageName: 'pytest-rerunfailures',
datasource: 'pypi',
depType: 'tool.pdm.dev-dependencies',
currentValue: '>=10.2',
depName: 'test/pytest-rerunfailures',
depName: 'pytest-rerunfailures',
},
{
packageName: 'tox',
datasource: 'pypi',
depType: 'tool.pdm.dev-dependencies',
skipReason: 'unspecified-version',
depName: 'tox/tox',
depName: 'tox',
},
{
packageName: 'tox-pdm',
datasource: 'pypi',
depType: 'tool.pdm.dev-dependencies',
currentValue: '>=0.5',
depName: 'tox/tox-pdm',
depName: 'tox-pdm',
},
]);
});
Expand Down Expand Up @@ -214,7 +214,7 @@ describe('modules/manager/pep621/extract', () => {
datasource: 'pypi',
depType: 'project.optional-dependencies',
currentValue: '>12',
depName: 'pytest/pytest',
depName: 'pytest',
registryUrls: [
'https://private-site.org/pypi/simple',
'https://private.pypi.org/simple',
Expand All @@ -225,7 +225,7 @@ describe('modules/manager/pep621/extract', () => {
datasource: 'pypi',
depType: 'tool.pdm.dev-dependencies',
currentValue: '>=10.2',
depName: 'test/pytest-rerunfailures',
depName: 'pytest-rerunfailures',
registryUrls: [
'https://private-site.org/pypi/simple',
'https://private.pypi.org/simple',
Expand All @@ -236,7 +236,7 @@ describe('modules/manager/pep621/extract', () => {
datasource: 'pypi',
depType: 'tool.pdm.dev-dependencies',
currentValue: '>=0.5',
depName: 'tox/tox-pdm',
depName: 'tox-pdm',
registryUrls: [
'https://private-site.org/pypi/simple',
'https://private.pypi.org/simple',
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/manager/pep621/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ export function parseDependencyGroupRecord(
}

const deps: PackageDependency[] = [];
for (const [groupName, pep508Strings] of Object.entries(records)) {
for (const pep508Strings of Object.values(records)) {
for (const dep of parseDependencyList(depType, pep508Strings)) {
deps.push({ ...dep, depName: `${groupName}/${dep.packageName!}` });
deps.push({ ...dep, depName: dep.packageName! });
}
}
return deps;
Expand Down

0 comments on commit 1891c08

Please sign in to comment.