|
| | _push_new_state (self) |
| |
|
| _add_to_criteria (self, criteria, requirement, parent) |
| |
| | _remove_information_from_criteria (self, criteria, parents) |
| |
|
| _get_preference (self, name) |
| |
|
| _is_current_pin_satisfying (self, name, criterion) |
| |
|
| _get_updated_criteria (self, candidate) |
| |
|
| _attempt_to_pin_criterion (self, name) |
| |
| | _backjump (self, causes) |
| |
Stateful resolution object.
This is designed as a one-off object that holds information to kick start
the resolution process, and holds the results afterwards.
| pip._vendor.resolvelib.resolvers.Resolution._backjump |
( |
|
self, |
|
|
|
causes |
|
) |
| |
|
protected |
Perform backjumping.
When we enter here, the stack is like this::
[ state Z ]
[ state Y ]
[ state X ]
.... earlier states are irrelevant.
1. No pins worked for Z, so it does not have a pin.
2. We want to reset state Y to unpinned, and pin another candidate.
3. State X holds what state Y was before the pin, but does not
have the incompatibility information gathered in state Y.
Each iteration of the loop will:
1. Identify Z. The incompatibility is not always caused by the latest
state. For example, given three requirements A, B and C, with
dependencies A1, B1 and C1, where A1 and B1 are incompatible: the
last state might be related to C, so we want to discard the
previous state.
2. Discard Z.
3. Discard Y but remember its incompatibility information gathered
previously, and the failure we're dealing with right now.
4. Push a new state Y' based on X, and apply the incompatibility
information from Y to Y'.
5a. If this causes Y' to conflict, we need to backtrack again. Make Y'
the new Z and go back to step 2.
5b. If the incompatibilities apply cleanly, end backtracking.