Skip to content

Commit

Permalink
allow uninstall by default only on removals
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Aug 29, 2023
1 parent 74ff234 commit e40f0da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions conda_libmamba_solver/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,14 @@ def _log_info(self):
def _setup_solver(self, index: LibMambaIndexHelper):
self._solver_options = solver_options = [
(api.SOLVER_FLAG_ALLOW_DOWNGRADE, 1),
(api.SOLVER_FLAG_ALLOW_UNINSTALL, 1),
(api.SOLVER_FLAG_INSTALL_ALSO_UPDATES, 1),
(api.SOLVER_FLAG_FOCUS_BEST, 1),
(api.SOLVER_FLAG_BEST_OBEY_POLICY, 1),
# (api.SOLVER_FLAG_FOCUS_BEST, 1),
# (api.SOLVER_FLAG_BEST_OBEY_POLICY, 1),
]
if context.channel_priority is ChannelPriority.STRICT:
solver_options.append((api.SOLVER_FLAG_STRICT_REPO_PRIORITY, 1))
if self.specs_to_remove and self._command in ("remove", None, NULL):
solver_options.append((api.SOLVER_FLAG_ALLOW_UNINSTALL, 1))

self.solver = api.Solver(index._pool, self._solver_options)

Expand Down

0 comments on commit e40f0da

Please sign in to comment.