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

Do provide state in offline mode #570

Merged
merged 3 commits into from
Nov 20, 2024
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
11 changes: 8 additions & 3 deletions conda_libmamba_solver/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def _fetch_one_repodata_json(self, url: str) -> tuple[str, os.PathLike, Repodata
# This might not exist (yet, anymore), but that's ok because we'll check
# for existence later and safely ignore if needed
json_path = subdir_data.cache_path_json
state = None
state = subdir_data.repo_cache.load_state()
else:
# TODO: This method loads reads the whole JSON file (does not parse)
json_path, state = subdir_data.repo_fetch.fetch_latest_path()
Expand Down Expand Up @@ -396,11 +396,16 @@ def _load_repo_info_from_json_path(
path=str(solv_path),
expected=repodata_origin,
channel_id=channel_id,
add_pip_as_python_dependency=context.add_pip_as_python_dependency,
add_pip_as_python_dependency=PipAsPythonDependency(
context.add_pip_as_python_dependency
),
)
except Exception as exc:
log.debug("Failed to load from SOLV. Trying JSON at %s", json_path, exc_info=exc)
log.debug("Failed to load from SOLV. Trying JSON.", exc_info=exc)
try:
log.debug(
"Loading %s (%s) from JSON repodata at %s", channel_id, channel_url, json_path
)
repo = self.db.add_repo_from_repodata_json(
path=str(json_path),
url=channel_url,
Expand Down
19 changes: 19 additions & 0 deletions news/570-solv-slowdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* Load SOLV repodata cache in offline mode too. (#570)

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>