Skip to content

Commit

Permalink
feat(manager/pipenv): set currentVersion field for exact dependency v…
Browse files Browse the repository at this point in the history
…ersions (#26769)
  • Loading branch information
Churro authored Jan 21, 2024
1 parent 4c2ce97 commit 360928b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/modules/manager/pipenv/extract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ describe('modules/manager/pipenv/extract', () => {
depType: 'packages',
depName: 'some-package',
currentValue: '==0.3.1',
currentVersion: '0.3.1',
datasource: 'pypi',
},
{
depType: 'packages',
depName: 'some-other-package',
currentValue: '==1.0.0',
currentVersion: '1.0.0',
datasource: 'pypi',
},
{
Expand All @@ -54,6 +56,7 @@ describe('modules/manager/pipenv/extract', () => {
depType: 'packages',
depName: 'pytest-benchmark',
currentValue: '==1.0.0',
currentVersion: '1.0.0',
datasource: 'pypi',
managerData: {
nestedVersion: true,
Expand All @@ -63,6 +66,7 @@ describe('modules/manager/pipenv/extract', () => {
depType: 'dev-packages',
depName: 'dev-package',
currentValue: '==0.1.0',
currentVersion: '0.1.0',
datasource: 'pypi',
},
],
Expand Down Expand Up @@ -94,30 +98,35 @@ describe('modules/manager/pipenv/extract', () => {
depType: 'packages',
depName: 'Django',
currentValue: '==1',
currentVersion: '1',
datasource: 'pypi',
},
{
depType: 'packages',
depName: 'distribute',
currentValue: '==0.6.27',
currentVersion: '0.6.27',
datasource: 'pypi',
},
{
depType: 'packages',
depName: 'dj-database-url',
currentValue: '==0.2',
currentVersion: '0.2',
datasource: 'pypi',
},
{
depType: 'packages',
depName: 'psycopg2',
currentValue: '==2.4.5',
currentVersion: '2.4.5',
datasource: 'pypi',
},
{
depType: 'packages',
depName: 'wsgiref',
currentValue: '==0.1.2',
currentVersion: '0.1.2',
datasource: 'pypi',
},
],
Expand Down Expand Up @@ -258,6 +267,7 @@ describe('modules/manager/pipenv/extract', () => {
depType: 'packages',
depName: 'requests',
currentValue: '==0.21.0',
currentVersion: '0.21.0',
datasource: 'pypi',
managerData: {
nestedVersion: true,
Expand Down
3 changes: 3 additions & 0 deletions lib/modules/manager/pipenv/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ function extractFromSection(
} else {
dep.datasource = PypiDatasource.id;
}
if (!skipReason && currentValue?.startsWith('==')) {
dep.currentVersion = currentValue.replace(regEx(/^==\s*/), '');
}
if (nestedVersion) {
// TODO #22198
dep.managerData!.nestedVersion = nestedVersion;
Expand Down

0 comments on commit 360928b

Please sign in to comment.