Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix --satisfied-skip-solve when spec does not match installed (but name does) #606

Merged
merged 2 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
19 changes: 19 additions & 0 deletions news/606-skip
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* Consider whether the full spec matches anything installed (not just name) when `--satisfied-skip-solve` is in use. (#605 via #606)

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>
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
)
Loading