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

Adopt new subdir/repodata API from upstream conda (@dholth's work) #135

Closed
Tracked by #59
jezdez opened this issue Feb 17, 2023 · 3 comments
Closed
Tracked by #59

Adopt new subdir/repodata API from upstream conda (@dholth's work) #135

jezdez opened this issue Feb 17, 2023 · 3 comments
Labels
locked [bot] locked due to inactivity

Comments

@jezdez
Copy link
Member

jezdez commented Feb 17, 2023

No description provided.

@jaimergp
Copy link
Contributor

jaimergp commented Mar 7, 2023

Can I have more info on this new API, @dholth? I've seen there's a RepodataInterface but that one doesn't check for the cache, right?

Ideally, what I'd like to use is a class (or a method of a class) that:

  • Validates channel name / URL / path
  • Checks if cache exists and is up-to-date.
  • Load it from the cache if the point above is true
  • Download from the remote otherwise, and populate the cache / states
  • It should not attempt to parse the JSON

Do we have such a setup right now?

@dholth
Copy link
Contributor

dholth commented Mar 7, 2023

This API is changing. https://github.com/conda/conda/pull/12090/files#diff-ff8022ba5d08310acbbc6f95e1bc77a53f69e00ffe6daa51026af8880f89612dR362

It's also demonstrated in this new test function https://github.com/conda/conda/blob/features/repodata-jlap/tests/gateways/test_jlap.py#L304 where you can ask SubdirData for the RepoInterface; pass it the state containing cache headers (now a class instead of a bare dict), and sometimes you get a "RepodataOnDisk" exception instead of the parsed json. Yes RepoInterface checks/follows the caching rules. The caller is also responsible for writing the cache headers back to disk though.

What are we trying to accomplish?

Very soon we need to add API to deal with locking correctly, to do all the cache/update saved headers automatically, and to prefer either parsed or not-parsed json (sometimes the cache must parse repodata.json anyway and would otherwise write-to-disk-and-reread) so that the caller can avoid all extra json parsing.

@jaimergp
Copy link
Contributor

Closing as part of #59

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Apr 11, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

No branches or pull requests

3 participants