Skip to content

Commit

Permalink
fix(pep621): handle dependency-groups (PEP 735) in pdm lockfile updat…
Browse files Browse the repository at this point in the history
…es (#32952)
  • Loading branch information
Churro authored Dec 6, 2024
1 parent 5cb9980 commit 9f600d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/modules/manager/pep621/processors/pdm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ describe('modules/manager/pep621/processors/pdm', () => {
managerData: { depGroup: 'group3' },
},
{ packageName: 'dep9', depType: depTypes.buildSystemRequires },
{
packageName: 'dep10',
depType: depTypes.dependencyGroups,
managerData: { depGroup: 'dev' },
},
];
const result = await processor.updateArtifacts(
{
Expand Down Expand Up @@ -205,6 +210,9 @@ describe('modules/manager/pep621/processors/pdm', () => {
{
cmd: 'pdm update --no-sync --update-eager -dG group3 dep7 dep8',
},
{
cmd: 'pdm update --no-sync --update-eager -dG dev dep10',
},
]);
});

Expand Down Expand Up @@ -232,6 +240,10 @@ describe('modules/manager/pep621/processors/pdm', () => {
packageName: 'dep5',
depType: depTypes.pdmDevDependencies,
},
{
packageName: 'dep10',
depType: depTypes.dependencyGroups,
},
];
const result = await processor.updateArtifacts(
{
Expand All @@ -244,7 +256,7 @@ describe('modules/manager/pep621/processors/pdm', () => {
);
expect(result).toBeNull();
expect(execSnapshots).toEqual([]);
expect(logger.once.warn).toHaveBeenCalledTimes(2);
expect(logger.once.warn).toHaveBeenCalledTimes(3);
});

it('return update on lockfileMaintenance', async () => {
Expand Down
1 change: 1 addition & 0 deletions lib/modules/manager/pep621/processors/pdm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ function generateCMDs(updatedDeps: Upgrade<Pep621ManagerData>[]): string[] {
);
break;
}
case depTypes.dependencyGroups:
case depTypes.pdmDevDependencies: {
if (is.nullOrUndefined(dep.managerData?.depGroup)) {
logger.once.warn(
Expand Down

0 comments on commit 9f600d1

Please sign in to comment.