Skip to content

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

Merged
charliermarsh merged 1 commit into
mainfrom
charlie/manifest
Apr 8, 2024
Merged

charliermarsh merged 1 commit into
mainfrom
charlie/manifest

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Apr 8, 2024 •

Copy link
Copy Markdown
Member

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
@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