Skip to content

Commit

Permalink
fix(setup_cfg): parsing for requirements install requires (#20657)
Browse files Browse the repository at this point in the history
  • Loading branch information
sukelly authored Feb 28, 2023
1 parent 2a00271 commit 456a8da
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/modules/manager/setup-cfg/__fixtures__/setup-cfg-1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ install_requires =

requests[security] ~=2.18
compact~=1.2.3;python>'3.10'
install_requires=
responses >=2.27.0

setup_requires =
six ~=1.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ exports[`modules/manager/setup-cfg/extract extractPackageFile() extracts depende
"depName": "compact",
"depType": "install",
},
{
"currentValue": ">=2.27.0",
"datasource": "pypi",
"depName": "responses",
"depType": "install",
},
{
"currentValue": "~=1.4",
"datasource": "pypi",
Expand Down
1 change: 1 addition & 0 deletions lib/modules/manager/setup-cfg/extract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe('modules/manager/setup-cfg/extract', () => {
{ depName: 'nmspc.pkg', currentValue: '==1.0' },
{ depName: 'requests', currentValue: '~=2.18' },
{ depName: 'compact', currentValue: '~=1.2.3' },
{ depName: 'responses', currentValue: '>=2.27.0' },
{ depName: 'six', currentValue: '~=1.4' },
{ depName: 'tqdm', currentValue: '~=4.19' },
{ depName: 'tenacity', currentValue: '~=6.0' },
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/manager/setup-cfg/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function getSectionName(str: string): string {
}

function getSectionRecord(str: string): string {
const [, sectionRecord] = regEx(/^([^\s]+)\s+=/).exec(str) ?? [];
const [, sectionRecord] = regEx(/^([^\s]+)\s*=/).exec(str) ?? [];
return sectionRecord;
}

Expand Down

0 comments on commit 456a8da

Please sign in to comment.