Skip to content

Commit 501cc33

Browse files
committed
Revert Binary.load_or_install restoration
Per maintainer feedback: the removal was intentional — callsites should use ``install()`` directly (which is already a no-op short-circuit when ``is_valid`` and no ``no_cache`` is set). Reverting the restored helper and leaving it to the plugin hooks to adopt ``install()``.
1 parent b47698a commit 501cc33

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

abxpkg/binary.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -451,41 +451,6 @@ def load(
451451
)
452452
raise BinaryLoadError(self.name, provider_names, errors) from inner_exc
453453

454-
@validate_call
455-
@log_method_call(include_result=True)
456-
def load_or_install(
457-
self,
458-
binproviders: list[BinProviderName] | None = None,
459-
no_cache: bool = False,
460-
dry_run: bool | None = None,
461-
postinstall_scripts: bool | None = None,
462-
min_release_age: float | None = None,
463-
**extra_overrides,
464-
) -> Self:
465-
"""Try ``load()`` first; fall back to ``install()`` if no provider
466-
resolves the binary. Returns the loaded/installed copy of ``self``.
467-
"""
468-
try:
469-
loaded = self.load(
470-
binproviders=binproviders,
471-
no_cache=no_cache,
472-
**extra_overrides,
473-
)
474-
except BinaryLoadError:
475-
loaded = self
476-
# ``load()`` was already called with the caller's ``no_cache`` flag, so
477-
# a valid result is already fresh — trust it and skip ``install()``.
478-
if loaded.is_valid:
479-
return loaded
480-
return self.install(
481-
binproviders=binproviders,
482-
no_cache=no_cache,
483-
dry_run=dry_run,
484-
postinstall_scripts=postinstall_scripts,
485-
min_release_age=min_release_age,
486-
**extra_overrides,
487-
)
488-
489454
@validate_call
490455
@log_method_call(include_result=True)
491456
def update(

0 commit comments

Comments
 (0)