Skip to content

Commit

Permalink
-S, --satisfied-skip-solve: check that spec doesn't match anything in…
Browse files Browse the repository at this point in the history
…stalled too
  • Loading branch information
jaimergp committed Jan 24, 2025
1 parent 17adb32 commit 4ca1531
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions conda_libmamba_solver/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,12 @@ def early_exit(self) -> IndexedSet[PackageRecord]:

if sis.force_remove:
return force_remove_solution

if sis.update_modifier.SPECS_SATISFIED_SKIP_SOLVE and not sis.is_removing:
elif sis.update_modifier.SPECS_SATISFIED_SKIP_SOLVE:
for name, spec in sis.requested.items():
if name not in sis.installed:
break
if not any(spec.match(record) for record in sis.installed.values()):
break
else:
# All specs match a package in the current environment.
# Return early, with the current solution (at this point, .records is set
Expand Down
7 changes: 7 additions & 0 deletions tests/test_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,3 +580,10 @@ def test_prune_existing_env_dependencies_are_solved(conda_cli, tmp_path):
print(out)
print(err, file=sys.stderr)
assert rc == 0


def test_satisfied_skip_solve_matchspec(conda_cli, tmp_env):
with tmp_env("ca-certificates") as prefix:
conda_cli(
"install", "-p", prefix, "-S", "ca-certificates>10000", raises=PackagesNotFoundError
)

0 comments on commit 4ca1531

Please sign in to comment.