Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._vendor.resolvelib.resolvers Namespace Reference

Data Structures

class  Criterion
 
class  InconsistentCandidate
 
class  RequirementsConflicted
 
class  Resolution
 
class  ResolutionError
 
class  ResolutionImpossible
 
class  ResolutionTooDeep
 
class  Resolver
 
class  ResolverException
 

Functions

 _has_route_to_root (criteria, key, all_keys, connected)
 
 _build_result (state)
 

Variables

 RequirementInformation
 
 State = collections.namedtuple("State", "mapping criteria backtrack_causes")
 
 Result = collections.namedtuple("Result", "mapping graph criteria")
 

Function Documentation

◆ _build_result()

_build_result (   state)
protected

Definition at line 482 of file resolvers.py.

482def _build_result(state):
483 mapping = state.mapping
484 all_keys = {id(v): k for k, v in mapping.items()}
485 all_keys[id(None)] = None
486
487 graph = DirectedGraph()
488 graph.add(None) # Sentinel as root dependencies' parent.
489
490 connected = {None}
491 for key, criterion in state.criteria.items():
492 if not _has_route_to_root(state.criteria, key, all_keys, connected):
493 continue
494 if key not in graph:
495 graph.add(key)
496 for p in criterion.iter_parent():
497 try:
498 pkey = all_keys[id(p)]
499 except KeyError:
500 continue
501 if pkey not in graph:
502 graph.add(pkey)
503 graph.connect(pkey, key)
504
505 return Result(
506 mapping={k: v for k, v in mapping.items() if k in connected},
507 graph=graph,
508 criteria=state.criteria,
509 )
510
511
for i

References pip._vendor.resolvelib.resolvers._has_route_to_root(), i, and pip._vendor.resolvelib.resolvers.Result.

Referenced by Resolver.resolve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _has_route_to_root()

_has_route_to_root (   criteria,
  key,
  all_keys,
  connected 
)
protected

Definition at line 460 of file resolvers.py.

460def _has_route_to_root(criteria, key, all_keys, connected):
461 if key in connected:
462 return True
463 if key not in criteria:
464 return False
465 for p in criteria[key].iter_parent():
466 try:
467 pkey = all_keys[id(p)]
468 except KeyError:
469 continue
470 if pkey in connected:
471 connected.add(key)
472 return True
473 if _has_route_to_root(criteria, pkey, all_keys, connected):
474 connected.add(key)
475 return True
476 return False
477
478

References pip._vendor.resolvelib.resolvers._has_route_to_root(), and i.

Referenced by pip._vendor.resolvelib.resolvers._build_result(), and pip._vendor.resolvelib.resolvers._has_route_to_root().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ RequirementInformation

RequirementInformation
Initial value:
2 "RequirementInformation", ["requirement", "parent"]
3)

Definition at line 8 of file resolvers.py.

Referenced by Resolution._add_to_criteria().

◆ Result

Result = collections.namedtuple("Result", "mapping graph criteria")

Definition at line 479 of file resolvers.py.

Referenced by pip._vendor.resolvelib.resolvers._build_result().

◆ State

State = collections.namedtuple("State", "mapping criteria backtrack_causes")

Definition at line 102 of file resolvers.py.

Referenced by Resolution._push_new_state(), and Resolution.resolve().