Skip to content

Commit

Permalink
Always add dependencies of a package, even if the strictness is 3
Browse files Browse the repository at this point in the history
This removes errors like

AssertionError: paramiko-1.14.0-py34_0.tar.bz2 MatchSpec('pycrypto 2.6.1')

and fixes conda/conda-build#205.
  • Loading branch information
asmeurer committed Sep 17, 2014
1 parent 03adc8b commit 3077dc1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
3 changes: 1 addition & 2 deletions conda/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,7 @@ def add_dependents(fn1, max_only=False):
continue
res[pkg2.fn] = pkg2
try:
if ms.strictness < 3:
add_dependents(pkg2.fn, max_only=max_only)
add_dependents(pkg2.fn, max_only=max_only)
except NoPackagesFound as e:
for pkg in e.pkgs:
if pkg not in notfound:
Expand Down
29 changes: 29 additions & 0 deletions tests/test_resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,3 +1143,32 @@ def test_no_features():
'tk-8.5.13-0.tar.bz2',
'zlib-1.2.7-0.tar.bz2',
]][0]

def test_mixed_strictness():
# Don't behave differently for strictness == 3 in the dependencies
index2 = index.copy()
index2['package1-1.0-0.tar.bz2'] = {
'build': '0',
'build_number': 0,
'depends': ['pandas 0.11.0 np17py33_1', 'python 3.3*', 'numpy 1.7*'],
'name': 'package1',
'version': '1.0',
}
r = Resolve(index2)

assert r.solve2(['package1'], set()) == [
'dateutil-2.1-py33_1.tar.bz2',
'numpy-1.7.1-py33_0.tar.bz2',
'openssl-1.0.1c-0.tar.bz2',
'package1-1.0-0.tar.bz2',
'pandas-0.11.0-np17py33_1.tar.bz2',
'python-3.3.2-0.tar.bz2',
'pytz-2013b-py33_0.tar.bz2',
'readline-6.2-0.tar.bz2',
'scipy-0.12.0-np17py33_0.tar.bz2',
'six-1.3.0-py33_0.tar.bz2',
'sqlite-3.7.13-0.tar.bz2',
'system-5.8-1.tar.bz2',
'tk-8.5.13-0.tar.bz2',
'zlib-1.2.7-0.tar.bz2',
]

0 comments on commit 3077dc1

Please sign in to comment.