Skip to content

Commit

Permalink
parse "excluded by strict priority" errors as conflicts (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp authored Nov 2, 2023
1 parent 27d164c commit 5655bda
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions conda_libmamba_solver/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,9 @@ def _parse_problems(cls, problems: str) -> Mapping[str, MatchSpec]:
pin_b = words[5].rsplit("-", 1)[0]
conflicts.append(MatchSpec(pin_a))
conflicts.append(MatchSpec(pin_b))
elif "is excluded by strict repo priority" in line:
# package python-3.7.6-h0371630_2 is excluded by strict repo priority
conflicts.append(cls._str_to_matchspec(words[2]))
else:
log.debug("! Problem line not recognized: %s", line)

Expand Down Expand Up @@ -712,6 +715,10 @@ def _prepare_problems_message(self, pins=None):
# This error makes 'explain_problems()' crash. Anticipate.
log.info("Failed to explain problems. Unsupported request.")
return legacy_errors
if "is excluded by strict repo priority" in legacy_errors:
# This will cause a lot of warnings until implemented in detail explanations
log.info("Skipping error explanation. Excluded by strict repo priority.")
return legacy_errors
try:
explained_errors = self.solver.explain_problems()
except Exception as exc:
Expand Down
19 changes: 19 additions & 0 deletions news/343-excluded-strict-priority
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* Interpret "excluded by strict priority" solver errors as proper satisfiability conflicts and avoid printing related yet uninformative warnings. (#343)

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>

0 comments on commit 5655bda

Please sign in to comment.