Skip to content

Commit

Permalink
feat(manager/pep621): allow auto grouping of dependencies in differen…
Browse files Browse the repository at this point in the history
…t groups (#28193)

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
  • Loading branch information
secustor and viceice authored Apr 2, 2024
1 parent d9ba74d commit 05dcbc8
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 05dcbc8

Please sign in to comment.