Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "depend on a specific version" of virtualenv. #17

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions lib/virtualenv.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -177,8 +183,7 @@ VirtualEnv.prototype._find = function _find(callback) {
// Propagate pypi error callback.
}, function(err) {
callback(new Error("unable to retrieve version information for virtualenv"));
});

}, true);
}

VirtualEnv.prototype._download = function _download(url, callback) {
Expand Down
23 changes: 6 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}

}