From 2ad12cc84e6a89aa905fde8dc3771276766e90cc Mon Sep 17 00:00:00 2001
From: Sebastian Poxhofer <secustor@users.noreply.github.com>
Date: Tue, 2 Apr 2024 12:38:44 +0200
Subject: [PATCH] feat(manager/pep621)!: remove group name from depName
 (#28193)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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.
---
 lib/modules/manager/pep621/extract.spec.ts | 18 +++++++++---------
 lib/modules/manager/pep621/utils.ts        |  4 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/lib/modules/manager/pep621/extract.spec.ts b/lib/modules/manager/pep621/extract.spec.ts
index e7147e912b..d86e5d419a 100644
--- a/lib/modules/manager/pep621/extract.spec.ts
+++ b/lib/modules/manager/pep621/extract.spec.ts
@@ -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',
         },
       ]);
 
@@ -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',
         },
       ]);
     });
@@ -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',
@@ -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',
@@ -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',
diff --git a/lib/modules/manager/pep621/utils.ts b/lib/modules/manager/pep621/utils.ts
index d81deb8b98..13293e38c2 100644
--- a/lib/modules/manager/pep621/utils.ts
+++ b/lib/modules/manager/pep621/utils.ts
@@ -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;
-- 
GitLab