Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use local cache when bootstrapping #528

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/fromager/bootstrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(
self.ctx = ctx
self.progressbar = progressbar or progress.Progressbar(None)
self.prev_graph = prev_graph
self.cache_wheel_server_url = cache_wheel_server_url
self.cache_wheel_server_url = cache_wheel_server_url or ctx.wheel_server_url
self.why: list[tuple[RequirementType, Requirement, Version]] = []
# Push items onto the stack as we start to resolve their
# dependencies so at the end we have a list of items that need to
Expand Down Expand Up @@ -335,7 +335,10 @@ def _download_wheel_from_cache(
cached_wheel = wheels.download_wheel(
req=req, wheel_url=wheel_url, output_directory=self.ctx.wheels_downloads
)
server.update_wheel_mirror(self.ctx)
if self.cache_wheel_server_url != self.ctx.wheel_server_url:
# Only update the local server if we actually downloaded
# something from a different server.
server.update_wheel_mirror(self.ctx)
logger.info(f"{req.name}: found built wheel on cache server")
unpack_dir = self._create_unpack_dir(req, resolved_version)
dist_filename = f"{dist_name}-{dist_version}"
Expand Down
2 changes: 1 addition & 1 deletion src/fromager/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@contextmanager
def open_file_or_url(
path_or_url: str | pathlib.Path,
) -> typing.Generator[io.TextIOWrapper, typing.Any, None]:
) -> typing.Generator[io.TextIOBase, typing.Any, None]:
location = str(path_or_url)
if location.startswith("file://"):
location = urlparse(location).path
Expand Down
Loading