-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Support pip wheel
subcommand
#1681
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
Comments
We have all the plumbing to do this, I'm not sure where it fits on our roadmap though. I'm curious how this would relate to |
Pip would prefer to remove the
|
Thanks for the additional context. I wonder what we can provide for people who want to generate wheels for all their dependencies though. It makes sense for pre-building and sharing when they aren't distributed by the original package. |
I echo this. |
But it doesn’t actually put wheels in the wheelhouse if there’s already a built wheel, IIRC? Pip download will get everything you need then you can loop over any SDists and build them if you need them? |
@henryiii I'm not entirely sure what you mean with that?
Sure. Actually |
That said, |
That's the problem, it does not store wheels that are downloaded. So if you depend on |
That's strange. It is not my understanding of how Now if the purpose is uploading wheels to an index, I'd use |
I’ll investigate, maybe it changed or there’s an another reason it was behaving like that. |
I'd like an
|
Small comment on that one (I do not contest the need for pip wheel of course just explaining how we are doing it in Airflow). I found that you can do quite a bit better than that by just copying the whole Smthing like:
That saves the hassle of running |
Just to second this issue, my pipeline is dependent on the recursive nature of |
I tend to think of
The default is not the most common operation during development, and the functional behaviour provided by None the less, my two cents would be that this shim should not be provided and uv should instead focus on its own dedicated CLI outside of the pip namespace; keeping these two "consumer" and "publisher" pieces separated. |
To second this issue, In our usecase we build the wheel once ( |
FWIW I added a concrete example of how I use pip wheel to #7148 if it's helpful in motivating this feature. |
The command |
The issue is that the new command doesn’t build the dependencies. Neither the local dependencies in the workspace nor the remote dependencies from the package index. |
This would be useful for packaging Blender extensions, which need their dependencies bundled as wheels in a subdirectory: https://docs.blender.org/manual/en/dev/advanced/extensions/python_wheels.html |
Hey, it's great to hear that, there are some of my thoughts about combined version of
As mentioned in examples in there, I think it could be solved by index filtering (May need to have extra index configuration in |
@Tremeschin yeah, that's the thing, pip install / wheel / download are all expressions of the same base concept, except doing slightly different things (ie. wheel is just download, except it also builds if it can't pull a wheel directly from the index). |
@T-256 you read my mind, I was also thinking of the exact nomenclature of It also ties in to a higher-level abstraction of the cache itself, ie |
I'd request a |
You have to build local packages to get the dependency list, though? You can shortcut it in the case of a PEP 621 package without dependencies in the dynamic array, and some backends let you shortcut the build with the get metadata hook, but sometimes you have to build the package to get the deps. |
That dependency information is already in the lock file but otherwise yes you would need to build/discard it to get the metadata if you didn't have a lock file. |
FWIW our use case for You can get a such a list already using |
I've got multiple uses of "pip wheel", one of them is as many others, artifacts for a build or multi-stage pipeline, where we also separate dev dependencies (linters, etc) from real deps, so we can always use the same for child pipelines. Sometimes these end up in a kind of "dev container" that's used as a base, in order to prevent updated packages in repositories from causing new fun issues. The other case is to make sure our internal repo has cached binary builds of certain projects for non x86_64 platforms, fex. lxml, cryptography, etc. So, for that reason, being able to download or build both |
Actually, including wheels you don't "own" is desirable for several use cases, namely for private PyPI-like repositories (e.g. Google Artifact registry, AWS CodeArtifact et al.) at least:
|
@abhiaagarwal hey! Did you make any progress on this? :D |
@ion-elgreco I had, and then we managed to solve the problem without the use of I can publish a WIP branch once I rebase on main, if that would be useful for you? |
@abhiaagarwal really curious as well if you have a tl;dr of how you accomplished this. |
Is anyone working on this feature? I could really use it. |
Haven't had cycles to rebase recently, but the general idea is you can pull directly from uv's wheel cache using the same logic as the sync command, just into a directory rather than a venv. This is also how pip download can be naturally supported. |
Is this being worked on currently? I am considering adopting uv as the dependency manager of choice for my application but found a post mentioning that, "uv doesn't generate wheels, so my quest is: UV unusable for 2-stage docker image building" (medium link) and would I have to work around UV by using requirements.txt or pip directly. Additionally, how difficult is this to implement, is this something a new contributor can pick up? |
I'd also love to see some functionality like this in uv. I'm still using It would be even better if |
I opened a draft MR for this, after looking through uv's cache at work on a whim and realizing uv's cache internal archive format is entirely identical to a wheel (validated with That being said, treating |
Reminder,
I believe |
|
I thought that I had posted it but I can't find it in here -- |
@waynew that's just using |
Ah - yes; apparently I forgot to include that bit. It's definitely just a workaround -- mainly it avoids the scenario where your platform doesn't like installing Though... now I wonder if there's a Anyway -- entirely ➕ 💯 on uv having a baked-in command. For anyone who still needs to download deps, but also wants to use |
@BradyAJohnston @waynew the problem is the cache, uv caches installed packages, but pip caches distributions. At the moment it's not clear to me, without a cache redesign, that uv would be faster than pip, when cache is available pip can simply copy the files, but uv either needs to try and recreate the wheels (it can't recreate sdists) or redownload them. When cache isn't available the scenario tends to be dominated by IO, uv downloads concurrently but this doesn't always help and in some edge cases slows things down. Maybe uv would be better suited by coming up with its own solution to your use case rather than copying pip. For example having a command that creates one zip file, or a zip file per package, of the relevant uv cached packages, and uv can be pointed to that file and extract them from there. |
I wouldn't claim to have a comprehensive scenario of folks' Not sure how this fits in with uv's caching model, but it's my current approach that works! |
Our workflow would benefit from the caching being shared across:
In the past we've seen a lot of time wasted by these steps individually repeating expensive builds of packages including native code (eg. numpy, uwsgi), which is why a common cache between all three is helpful. Right now there's no way to avoid steps 1 & 3 doing redundant work Step 3 could hypothetically be replaced by hacking something out of |
I've been trying
uv
on work projects to assess its coverage and suitability of being a fullpip
/pip-tools
replacement for us. One of the features of pip that we use ispip wheel
, which seems to not be supported byuv
currently and I couln't find an open ticket discussing it, so I'm making one here.The text was updated successfully, but these errors were encountered: