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

Add a layer of indirection to the local path-based wheel cache #2909

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Apr 8, 2024

Summary

Right now, the path-based wheel cache just looks at the symlink to the archives directory, checks the timestamp on it, and continues with that symlink as long as the timestamp is up-to-date.

The HTTP-based wheel meanwhile, uses an intermediary .http file, which includes the HTTP caching information. The .http file's payload is just a path pointing to an entry in the archives directory.

This PR modifies the path-based codepaths to use a similar cache file, which stores a timestamp along with a path to the archives directory. The main advantage here is that we can add other data to this cache file (namely, hashes in the future).

Test Plan

Beyond existing tests, I also verified that this doesn't require a version bump:

git checkout main 
cargo run pip install ~/Downloads/zeal-0.0.1-py3-none-any.whl --cache-dir baz --reinstall
git checkout charlie/manifest
cargo run pip install ~/Downloads/zeal-0.0.1-py3-none-any.whl --cache-dir baz --reinstall
cargo run pip install ~/Downloads/zeal-0.0.1-py3-none-any.whl --cache-dir baz --reinstall --refresh

@charliermarsh charliermarsh added the internal A refactor or improvement that is not user-facing label Apr 8, 2024
@charliermarsh charliermarsh marked this pull request as ready for review April 8, 2024 19:17
@charliermarsh charliermarsh enabled auto-merge (squash) April 8, 2024 19:30
@charliermarsh charliermarsh merged commit c46772e into main Apr 8, 2024
35 checks passed
@charliermarsh charliermarsh deleted the charlie/manifest branch April 8, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal A refactor or improvement that is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant