From 8b9d4b106cfa2d44fdbab9bebe1e8623a88a35dd Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Wed, 6 Jun 2018 12:12:28 +0200 Subject: [PATCH] fix(pep440): return ==version when pinning --- lib/versioning/pep440/range.js | 2 +- .../process/lookup/__snapshots__/index.spec.js.snap | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/versioning/pep440/range.js b/lib/versioning/pep440/range.js index e2450b6c30..5e9cb17f5f 100644 --- a/lib/versioning/pep440/range.js +++ b/lib/versioning/pep440/range.js @@ -3,7 +3,7 @@ module.exports = { }; function getNewValue(config, fromVersion, toVersion) { - if (config.currentValue.startsWith('==')) { + if (config.rangeStrategy === 'pin' || config.currentValue.startsWith('==')) { return '==' + toVersion; } logger.warn('Unsupported currentValue: ' + config.currentValue); diff --git a/test/workers/repository/process/lookup/__snapshots__/index.spec.js.snap b/test/workers/repository/process/lookup/__snapshots__/index.spec.js.snap index ec2bdc5dd6..ac1a4a521a 100644 --- a/test/workers/repository/process/lookup/__snapshots__/index.spec.js.snap +++ b/test/workers/repository/process/lookup/__snapshots__/index.spec.js.snap @@ -49,9 +49,10 @@ Array [ Object { "canBeUnpublished": false, "fromVersion": "0.9.4", + "isRange": true, "newMajor": 0, "newMinor": 9, - "newValue": "0.9.7", + "newValue": "==0.9.7", "repositoryUrl": "https://github.com/kriskowal/q", "toVersion": "0.9.7", "type": "minor", @@ -59,9 +60,10 @@ Array [ Object { "canBeUnpublished": false, "fromVersion": "0.9.4", + "isRange": true, "newMajor": 1, "newMinor": 4, - "newValue": "1.4.1", + "newValue": "==1.4.1", "repositoryUrl": "https://github.com/kriskowal/q", "toVersion": "1.4.1", "type": "major", -- GitLab