(
self,
target_configuration, # type: TargetConfiguration
target, # type: LocalInterpreter
pip_configuration, # type: PipConfiguration
refresh=False, # type: bool
locked_choice=LockedChoice.AUTO, # type: LockedChoice.Value
)
| 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 | |
| 461 | class EntryPointType(Enum["EntryPointType.Value"]): |
no test coverage detected