From db71b0c46bf17183ba72640de03404a9518ba005 Mon Sep 17 00:00:00 2001 From: Andres Kaasik Date: Tue, 6 Nov 2018 16:56:12 +0200 Subject: [PATCH 1/3] Return all available version numbers from getPackageReleases and convert returned values to semver format before selecting the version matching version number. --- lib/virtualenv.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/virtualenv.js b/lib/virtualenv.js index 29350dc..4833c84 100644 --- a/lib/virtualenv.js +++ b/lib/virtualenv.js @@ -146,8 +146,14 @@ VirtualEnv.prototype._find = function _find(callback) { // Find the latest valid version. var latestValidVersion; - versions.sort(function(a, b) { - return semver.lt(a, b); + versions.map(function(version) { + return semver.coerce(version); + }).filter(function(version) { + return version; + }).map(function(version) { + return version.raw; + }).sort(function(a, b) { + return semver.lt(a, b); }).some(function(version) { if (semver.satisfies(version, targetVersion)) { latestValidVersion = version; @@ -172,7 +178,8 @@ VirtualEnv.prototype._find = function _find(callback) { // Propagate pypi error callback. }, function(err) { callback(new Error("unable to retrieve release URLs for virtualenv " + latestValidVersion)); - }); + }, + true); // Propagate pypi error callback. }, function(err) { From 753d5afe7d10fd5a7c375bcf145aeb4e5bb2adb8 Mon Sep 17 00:00:00 2001 From: Andres Kaasik Date: Tue, 6 Nov 2018 17:12:46 +0200 Subject: [PATCH 2/3] The last parameter for getPackageReleases call was in wrong place. --- lib/virtualenv.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/virtualenv.js b/lib/virtualenv.js index 4833c84..6b48d55 100644 --- a/lib/virtualenv.js +++ b/lib/virtualenv.js @@ -178,14 +178,12 @@ VirtualEnv.prototype._find = function _find(callback) { // Propagate pypi error callback. }, function(err) { callback(new Error("unable to retrieve release URLs for virtualenv " + latestValidVersion)); - }, - true); + }); // Propagate pypi error callback. }, function(err) { callback(new Error("unable to retrieve version information for virtualenv")); - }); - + }, true); } VirtualEnv.prototype._download = function _download(url, callback) { From 8c84119ef3715fbe95502ebe3f46ef84464232d5 Mon Sep 17 00:00:00 2001 From: Andres Kaasik Date: Tue, 17 Sep 2019 10:24:39 +0300 Subject: [PATCH 3/3] Updated rimraf, glob and xmlrpc package versions. --- package.json | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index f3ea288..810d0b3 100644 --- a/package.json +++ b/package.json @@ -1,45 +1,34 @@ { - "name": "virtualenv", "version": "0.3.1", "description": "install and use Python dependencies in node with virtualenv", - "keywords": [ "python", "virtualenv", "rpc" ], - "repository": { - "type": "git", - "url": "https://github.com/mjpizz/node-virtualenv.git" + "type": "git", + "url": "https://github.com/mjpizz/node-virtualenv.git" }, - "main": "./lib/virtualenv.js", "engines": { - "node": ">=0.6" + "node": ">=0.6" }, - "dependencies": { - "request": "2.x", - "rimraf": "2.x", - "glob": "3.x", + "rimraf": "3.x", + "glob": "7.x", "tar": "2.x", "semver": "5.x", - "xmlrpc": "0.8.x" - + "xmlrpc": "1.3.x" }, - "bin": { "virtualenv-postinstall": "./bin/postinstall" }, - "license": "MIT", - "author": { "name": "Matt Pizzimenti", "url": "http://mjpizz.com" } - }