From 9f600d14457b3d99b08b255420c56cfda7dd2bf2 Mon Sep 17 00:00:00 2001 From: Johannes Feichtner <343448+Churro@users.noreply.github.com> Date: Fri, 6 Dec 2024 21:30:13 +0100 Subject: [PATCH] fix(pep621): handle dependency-groups (PEP 735) in pdm lockfile updates (#32952) --- lib/modules/manager/pep621/processors/pdm.spec.ts | 14 +++++++++++++- lib/modules/manager/pep621/processors/pdm.ts | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/modules/manager/pep621/processors/pdm.spec.ts b/lib/modules/manager/pep621/processors/pdm.spec.ts index 7d7f23252ad9c9..0a2da7d7fc54b9 100644 --- a/lib/modules/manager/pep621/processors/pdm.spec.ts +++ b/lib/modules/manager/pep621/processors/pdm.spec.ts @@ -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( { @@ -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', + }, ]); }); @@ -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( { @@ -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 () => { diff --git a/lib/modules/manager/pep621/processors/pdm.ts b/lib/modules/manager/pep621/processors/pdm.ts index 047be99f16b9c1..3a1f7d944ec523 100644 --- a/lib/modules/manager/pep621/processors/pdm.ts +++ b/lib/modules/manager/pep621/processors/pdm.ts @@ -193,6 +193,7 @@ function generateCMDs(updatedDeps: Upgrade[]): string[] { ); break; } + case depTypes.dependencyGroups: case depTypes.pdmDevDependencies: { if (is.nullOrUndefined(dep.managerData?.depGroup)) { logger.once.warn(