Skip to content

Commit

Permalink
Merge pull request conda#5836 from kalefranz/fix-force-install
Browse files Browse the repository at this point in the history
fix force_reinstall for case when packages aren't actually installed
  • Loading branch information
goanpeca authored Aug 16, 2017
2 parents 3d4062a + afbeae7 commit 84cc316
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion conda/core/solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ def solve_for_diff(self, deps_modifier=NULL, prune=NULL, ignore_pinned=NULL,
prec = next((rec for rec in final_precs if spec.match(rec)), None)
assert prec
link_precs.add(prec)
unlink_precs.add(prec)
if prec in previous_records:
unlink_precs.add(prec)

# TODO: add back 'noarch: python' to unlink and link if python version changes
# TODO: get the sort order correct for unlink_records
Expand Down
19 changes: 19 additions & 0 deletions tests/core/test_solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,25 @@ def test_force_reinstall_1():
assert not link_dists


def test_force_reinstall_2():
specs = MatchSpec("python=2"),
with get_solver(specs) as solver:
unlink_dists, link_dists = solver.solve_for_diff(force_reinstall=True)
assert not unlink_dists
# PrefixDag(final_state_1, specs).open_url()
print([Dist(rec).full_name for rec in link_dists])
order = (
'channel-1::openssl-1.0.1c-0',
'channel-1::readline-6.2-0',
'channel-1::sqlite-3.7.13-0',
'channel-1::system-5.8-1',
'channel-1::tk-8.5.13-0',
'channel-1::zlib-1.2.7-0',
'channel-1::python-2.7.5-0',
)
assert tuple(link_dists) == tuple(solver._index[Dist(d)] for d in order)


@pytest.mark.integration # this test is slower, so we'll lump it into integration
def test_freeze_deps_1(pytestconfig):

Expand Down

0 comments on commit 84cc316

Please sign in to comment.