Skip to content

Commit

Permalink
fix(manager/pip_setup): support namespaced packages (#19736)
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbsgilbs committed Jan 9, 2023
1 parent 27768c4 commit e70e6c7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/modules/manager/pip_setup/__fixtures__/setup.py
Expand Up @@ -78,6 +78,7 @@ class sdist(_sdist):
'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',
Expand Down
Expand Up @@ -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,
},
},
],
}
`;
1 change: 1 addition & 0 deletions lib/modules/manager/pip_setup/extract.spec.ts
Expand Up @@ -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' },
],
});
});
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/manager/pip_setup/extract.ts
Expand Up @@ -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})`,
Expand Down

0 comments on commit e70e6c7

Please sign in to comment.