Skip to content

Commit

Permalink
fix: correctly add multiple transitive deps
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-go committed Dec 23, 2017
1 parent 903f7ac commit 6a0f74b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plug/pip_resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ def create_children_recursive(root_package, key_tree):
[child_dist.key + VERSION_SEPARATOR +
child_dist.installed_version]}
create_children_recursive(child_package, key_tree)
root_package[DEPENDENCIES] = {
child_dist.project_name: child_package}
if DEPENDENCIES not in root_package:
root_package[DEPENDENCIES] = {}
root_package[DEPENDENCIES][child_dist.project_name] = child_package
return root_package

def create_dir_as_root():
Expand Down
31 changes: 31 additions & 0 deletions test/inspect.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ test('inspect', function (t) {
'django@1.6.1',
],
}, 'django looks ok');

t.match(pkg.dependencies.jinja2, {
name: 'jinja2',
version: '2.7.2',
Expand All @@ -70,6 +71,36 @@ test('inspect', function (t) {
},
},
}, 'jinja2 looks ok');

t.match(pkg.dependencies['python-etcd'], {
name: 'python-etcd',
version: '0.4.5',
from: [
'pip-app@0.0.0',
'python-etcd@0.4.5',
],
dependencies: {
dnspython: {
name: 'dnspython',
version: /.+$/,
from: [
'pip-app@0.0.0',
'python-etcd@0.4.5',
/dnspython@.+$/,
],
},
urllib3: {
name: 'urllib3',
version: /.+$/,
from: [
'pip-app@0.0.0',
'python-etcd@0.4.5',
/urllib3@.+$/,
],
},
},
}, 'python-etcd is ok');

t.end();
});

Expand Down
2 changes: 2 additions & 0 deletions test/workspaces/pip-app/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Jinja2==2.7.2
Django==1.6.1
python-etcd==0.4.5

0 comments on commit 6a0f74b

Please sign in to comment.