From e70e6c7d71824c03fd00b98100c07c9c54f9e33c Mon Sep 17 00:00:00 2001
From: Gilbert Gilb's <gilbsgilbs@users.noreply.github.com>
Date: Mon, 9 Jan 2023 13:34:13 +0100
Subject: [PATCH] fix(manager/pip_setup): support namespaced packages (#19736)

---
 lib/modules/manager/pip_setup/__fixtures__/setup.py       | 1 +
 .../manager/pip_setup/__snapshots__/extract.spec.ts.snap  | 8 ++++++++
 lib/modules/manager/pip_setup/extract.spec.ts             | 1 +
 lib/modules/manager/pip_setup/extract.ts                  | 2 +-
 4 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/modules/manager/pip_setup/__fixtures__/setup.py b/lib/modules/manager/pip_setup/__fixtures__/setup.py
index a819cf0ca5..3ecfce8515 100644
--- a/lib/modules/manager/pip_setup/__fixtures__/setup.py
+++ b/lib/modules/manager/pip_setup/__fixtures__/setup.py
@@ -78,6 +78,7 @@ setup(
         'raven>=5.27.1,<7.0', # pyup: nothing
         'future>=0.15.2,<0.17',
         'ipaddress>=1.0.16,<2.0;python_version<"3.3"',
+        'zope.interface>=5.5.2,<6.0.0',
     ],
     keywords=[
         'talisker',
diff --git a/lib/modules/manager/pip_setup/__snapshots__/extract.spec.ts.snap b/lib/modules/manager/pip_setup/__snapshots__/extract.spec.ts.snap
index 1f6497ad61..7246f4f88a 100644
--- a/lib/modules/manager/pip_setup/__snapshots__/extract.spec.ts.snap
+++ b/lib/modules/manager/pip_setup/__snapshots__/extract.spec.ts.snap
@@ -124,6 +124,14 @@ exports[`modules/manager/pip_setup/extract extractPackageFile() returns found de
         "lineNumber": 79,
       },
     },
+    {
+      "currentValue": ">=5.5.2,<6.0.0",
+      "datasource": "pypi",
+      "depName": "zope.interface",
+      "managerData": {
+        "lineNumber": 80,
+      },
+    },
   ],
 }
 `;
diff --git a/lib/modules/manager/pip_setup/extract.spec.ts b/lib/modules/manager/pip_setup/extract.spec.ts
index 9d94f95be9..8b852653ae 100644
--- a/lib/modules/manager/pip_setup/extract.spec.ts
+++ b/lib/modules/manager/pip_setup/extract.spec.ts
@@ -32,6 +32,7 @@ describe('modules/manager/pip_setup/extract', () => {
           { depName: 'raven', currentValue: '>=5.27.1,<7.0' },
           { depName: 'future', currentValue: '>=0.15.2,<0.17' },
           { depName: 'ipaddress', currentValue: '>=1.0.16,<2.0' },
+          { depName: 'zope.interface', currentValue: '>=5.5.2,<6.0.0' },
         ],
       });
     });
diff --git a/lib/modules/manager/pip_setup/extract.ts b/lib/modules/manager/pip_setup/extract.ts
index 197bca1f09..f94558ee2c 100644
--- a/lib/modules/manager/pip_setup/extract.ts
+++ b/lib/modules/manager/pip_setup/extract.ts
@@ -19,7 +19,7 @@ function cleanupNamedGroups(regexSource: string): string {
 
 const rangePattern = cleanupNamedGroups(RANGE_PATTERN);
 const versionPattern = `(?:${rangePattern}(?:\\s*,\\s*${rangePattern})*)`;
-const depNamePattern = '(?:[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])';
+const depNamePattern = '(?:[a-zA-Z][-_a-zA-Z0-9\\.]*[a-zA-Z0-9])';
 const depPattern = [
   '^',
   `(?<depName>${depNamePattern})`,
-- 
GitLab