MCPcopy
hub / github.com/pex-tool/pex / resolve

Method resolve

pex/cli/commands/run.py:430–458  ·  view source on GitHub ↗
(
        self,
        target_configuration,  # type: TargetConfiguration
        target,  # type: LocalInterpreter
        pip_configuration,  # type: PipConfiguration
        refresh=False,  # type: bool
        locked_choice=LockedChoice.AUTO,  # type: LockedChoice.Value
    )

Source from the content-addressed store, hash-verified

428 return os.path.join(cache_dir, script_name)
429
430 def resolve(
431 self,
432 target_configuration, # type: TargetConfiguration
433 target, # type: LocalInterpreter
434 pip_configuration, # type: PipConfiguration
435 refresh=False, # type: bool
436 locked_choice=LockedChoice.AUTO, # type: LockedChoice.Value
437 ):
438 # type: (...) -> Union[Tuple[str, Iterable[ParsedRequirement], LocalInterpreter], Error]
439
440 script = try_(
441 self._resolve_script(pip_configuration, refresh=refresh, locked_choice=locked_choice)
442 )
443 try:
444 script_metadata_application = apply_script_metadata(
445 scripts=[script],
446 requirement_configuration=RequirementConfiguration(),
447 target_configuration=target_configuration,
448 )
449 except Unsatisfiable as e:
450 return Error(str(e))
451
452 requirements = OrderedSet() # type: OrderedSet[ParsedRequirement]
453 if script_metadata_application.target_does_not_apply(target):
454 target = try_(_resolve_local_interpreter(target_configuration, script))
455 if script_metadata_application.requirement_configuration.requirements:
456 requirements.update(script_metadata_application.requirement_configuration.requirements)
457
458 return script, requirements, target
459
460
461class EntryPointType(Enum["EntryPointType.Value"]):

Callers 6

_distributions_outputMethod · 0.45
runMethod · 0.45
resolve_run_specMethod · 0.45
_resolve_toolMethod · 0.45
_createMethod · 0.45

Calls 9

_resolve_scriptMethod · 0.95
updateMethod · 0.95
try_Function · 0.90
apply_script_metadataFunction · 0.90
ErrorClass · 0.90
OrderedSetClass · 0.90
target_does_not_applyMethod · 0.80

Tested by

no test coverage detected