diff --git a/conda_libmamba_solver/state.py b/conda_libmamba_solver/state.py index aed7fc19..8c5092bf 100644 --- a/conda_libmamba_solver/state.py +++ b/conda_libmamba_solver/state.py @@ -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 diff --git a/news/606-skip b/news/606-skip new file mode 100644 index 00000000..fa37c268 --- /dev/null +++ b/news/606-skip @@ -0,0 +1,19 @@ +### Enhancements + +* + +### Bug fixes + +* Consider whether the full spec matches anything installed (not just name) when `--satisfied-skip-solve` is in use. (#605 via #606) + +### Deprecations + +* + +### Docs + +* + +### Other + +* diff --git a/tests/test_solver.py b/tests/test_solver.py index 9b916225..ee43baaa 100644 --- a/tests/test_solver.py +++ b/tests/test_solver.py @@ -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 + )