-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Cache wheels built from immutable VCS requirements #6851
Conversation
See my comment on your original issue here: #6640 (comment) I have a concern with adding a method pip/src/pip/_internal/vcs/git.py Lines 152 to 156 in 8720d32
Also, if the Git CLI encounters a branch whose name matches a SHA, it checks out the branch -- not the SHA. So pip's current behavior matches Git's behavior. |
Let's keep the discussion of "should we do this and how" in the tracking issue: #6640. :) |
@cjerdonek I just pushed an alternative implementation that caches the wheel if the revision in the URL is the commit hash that was checked out (using the existing |
91129be
to
c463d96
Compare
This comment has been minimized.
This comment has been minimized.
Hello! I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the |
Hello! I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the |
Hello! I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the |
447c56a
to
c86a988
Compare
I still need to write a couple of tests before removing the WIP status, but this PR is otherwise in good shape now. |
7be4be3
to
9086820
Compare
This one is ready for review. All concerns expressed so far have been addressed. The mechanism is actually quite straightforward: it decides to cache after cloning, by checking if the cloned commit hash is the one specified as revision in the URL. The implementation is also quite simple, now that the preliminary refactoring is done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good, scoped PR to me. Thanks @sbidoul! ^>^
I'll defer to others for reviewing this though, since I don't think I have the bandwidth to review this properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and clear 👍
Cache wheels that are built from Git requirements that contain an immutable revision (i.e. a sha).
Do not cache in case a branch/tag has the same name as a commit sha.
Rebased and verified it works as expected with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Great! Thanks for the review and merge. |
Cache wheels built from VCS requirements referring to an immutable revision (such as a git sha).
Closes #6640
TODO
Cache wheels that pip wheel built locally #6853refactor should_use_ephemeral_cache #7262support other VCS than Gitcan be left for future PRs