-
Notifications
You must be signed in to change notification settings - Fork 2.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 git dependencies as wheels #6896
Cache git dependencies as wheels #6896
Conversation
b3477ca
to
7f089ac
Compare
Overall the approach looks decent, I think it needs some refinement but this is a productive path. However, this is pretty low priority in the review backlog -- it will probably take some time to give detailed feedback. |
Thanks! In the meantime I'll try to extend the approach to Could you please set |
I'd be much less enthusiastic about this, it brings complexity to poetry - and increases reliance on pip - for what seems like a niche use case. If you're repeatedly using the same commit of a project, perhaps it would be better simply to build a wheel from that commit, and rely on that wheel. |
Poetry is not participating in Hacktoberfest; participation is opt-in this year (labeled repositories only) and we have not chosen to opt in. @dimbleby I agree it adds complexity and I think the implementation will need to change a decent amount to land this. However, I also think that this does not increase reliance on pip, as we were building those git clones like directory deps when they were non-Poetry projects anyway, and the way this PR is architected makes it easy to swap in That being said, there's nothing that stops us from incrementally introducing |
@neersighted re Hacktoberfest — got it, no problem. As for the use case, I don't think it's niche. IMO it affects everyone who runs CI jobs for projects with git dependencies and/or I'll try to update the PR following your suggestion about BTW, what is the point of removing |
7f089ac
to
a28e5e0
Compare
Your PR has moved from using the code we use for directory deps to a standalone solution for building and caching wheels; I was explaining that to @dimbleby. I would suggest that you preserve the scope of this PR, and experiment with We are working to extract pip from Poetry for a variety of reasons. These include:
You can see the WIP several maintainers are working on #6205. |
Thank you for the response. I still don't quite get what you mean by |
I mean the PyPI package, which has an API. |
Ah, thanks, now I see what you mean. I've never heard of that think before, will take a look. |
a28e5e0
to
0ee52b9
Compare
Hi @neersighted! I finally had time for this PR again. I've reworked my changes on top of PR #6205 which you mentioned. There is a lot of work done there, so it was actually pretty easy to add caching of wheels for git dependencies. I've set this PR's base branch to PR #6205, so that it can be incorporated into that feature once reviewed. Please tell me what do you think about this. |
510c7df
to
595af76
Compare
Co-authored-by: Randy Döring <[email protected]>
…t behavior of old installer)
…ored packaging is available
310e3c0
to
54c4ac3
Compare
Currently, poetry install will clone, build and install every git dependency when it's not present in the environment. This is OK for developer's machines, but not OK for CI - there environment is always fresh, and installing git dependencies takes significant time on each CI run, especially if the dependency has C extensions that need to be built. This commit builds a wheel for every git dependency that has precise reference hash in lock file and is not required to be in editable mode, stores that wheel in a cache dir and will install from it instead of cloning the repository again.
0ee52b9
to
3d72da1
Compare
@neersighted hi! Can I ping you on this one? This is an useful feature IMO, and PR code is now actually pretty concise. |
bd35898
to
11efc64
Compare
82d0bde
to
838f0ee
Compare
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Currently, poetry install will clone, build and install every git dependency when it's not present in the environment. This is OK for developer's machines, but not OK for CI - there environment is always fresh, and installing git dependencies takes significant time on each CI run, especially if the dependency has C extensions that need to be built.
This commit builds a wheel for every git dependency that has precise reference hash in lock file and is not required to be in editable mode, stores that wheel in a cache dir and will install from it instead of cloning the repository again.
Pull Request Check List
Resolves:
I've checked locally that this code works, can you give me an advice on how test could look like?
Should this approach also be extended to handle 'tar.gz'-only distributions? See #3439 for rationale.