Skip to content
Snippets Groups Projects
Unverified Commit ca80f6c2 authored by Johannes Feichtner's avatar Johannes Feichtner Committed by GitHub
Browse files

feat(manager/pep621): set currentVersion field for exact dependency versions (#27061)

parent b2bc5919
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,7 @@ describe('modules/manager/pep621/extract', () => {
datasource: 'pypi',
depType: 'project.dependencies',
currentValue: '==20.0.0',
currentVersion: '20.0.0',
},
{
packageName: 'pyproject-hooks',
......@@ -276,6 +277,7 @@ describe('modules/manager/pep621/extract', () => {
expect(result?.deps).toEqual([
{
currentValue: '==2.30.0',
currentVersion: '2.30.0',
datasource: 'pypi',
depName: 'requests',
depType: 'project.dependencies',
......@@ -290,6 +292,7 @@ describe('modules/manager/pep621/extract', () => {
},
{
currentValue: '==6.5',
currentVersion: '6.5',
datasource: 'pypi',
depName: 'coverage',
depType: 'tool.hatch.envs.default',
......@@ -347,6 +350,7 @@ describe('modules/manager/pep621/extract', () => {
expect(result?.deps).toEqual([
{
currentValue: '==2.30.0',
currentVersion: '2.30.0',
datasource: 'pypi',
depName: 'requests',
depType: 'project.dependencies',
......@@ -354,6 +358,7 @@ describe('modules/manager/pep621/extract', () => {
},
{
currentValue: '==1.18.0',
currentVersion: '1.18.0',
datasource: 'pypi',
depName: 'hatchling',
depType: 'build-system.requires',
......@@ -361,6 +366,7 @@ describe('modules/manager/pep621/extract', () => {
},
{
currentValue: '==69.0.3',
currentVersion: '69.0.3',
datasource: 'pypi',
depName: 'setuptools',
depType: 'build-system.requires',
......
......@@ -70,6 +70,10 @@ export function pep508ToPackageDependency(
dep.skipReason = 'unspecified-version';
} else {
dep.currentValue = parsed.currentValue;
if (parsed.currentValue.startsWith('==')) {
dep.currentVersion = parsed.currentValue.replace(regEx(/^==\s*/), '');
}
}
return dep;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment