Skip to content

Commit

Permalink
Fix track-features when there is no package with feature yet.
Browse files Browse the repository at this point in the history
When solving dependencies and listing the installed features, it was
being considered only features present on field "features" and not on
"track-features".
  • Loading branch information
gqmelo committed Aug 5, 2015
1 parent d155907 commit fe72767
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion conda/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ def installed_features(self, installed):
res = set()
for fn in installed:
try:
res.update(self.features(fn))
res.update(self.track_features(fn))
except KeyError:
pass
return res
Expand Down
26 changes: 26 additions & 0 deletions tests/test_resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,32 @@ def test_nonexistent_deps():
'zlib-1.2.7-0.tar.bz2',
]


def test_install_package_with_feature():
index2 = index.copy()
index2['mypackage-1.0-featurepy33_0.tar.bz2'] = {
'build': 'featurepy33_0',
'build_number': 0,
'depends': ['python 3.3*'],
'name': 'mypackage',
'version': '1.0',
'features': 'feature',
}
index2['feature-1.0-py33_0.tar.bz2'] = {
'build': 'py33_0',
'build_number': 0,
'depends': ['python 3.3*'],
'name': 'mypackage',
'version': '1.0',
'track_features': 'feature',
}

r = Resolve(index2)

# It should not raise
r.solve(['mypackage'], installed=['feature-1.0-py33_0.tar.bz2'])


def test_circular_dependencies():
index2 = index.copy()
index2['package1-1.0-0.tar.bz2'] = {
Expand Down

0 comments on commit fe72767

Please sign in to comment.