-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Consider using uv as an optional alternate resolver. #2371
Comments
Yeah, saw that. It won't be useable for It's also nominally 3.8+. The existing PipVersion infra does handle ranges of Python Pip works for though; so that bump should be handleable. Honestly though, if they achieve their vision and it remains Apache 2 / MIT, Pex should ~die and perhaps only live on as a package format uv produces. When I get a chance I always lobby Python / PyPA for 1 true tool, and that is what uv may become. |
Maybe by the time the uv rise to the one true tool comes to pass - which is insane - Your language's tool in another language becuase yours is too damn slow - Mojo will have killed off Python! Hah. |
Maybe Python becomes an intermediate scripting language that GenAI transpiles to Rust. |
Lots of people reacting to this - I'm going to assume that means folks agree Python / Pip / Pex are too slow right now and there is demand for the fast uv offers. If so, and you're feeling lock resolve pain, this has been hanging there for a long time now:
That's probably fairly involved, but if any one wants to dive in, that'd be great. I'm a bit async depending on climbing, but I'm happy to answer questions, review PRs, etc. On the slow PEX build end, which is mainly for larger PEX zips, there is the relatively recent Pex support for As to other pain points related to speed, I may have lost track and would certainly appreciate folks speaking up here. I could then organize and break out issues for any problems that seem solvable. |
One thing that struck me is most folks are probably ignorant of pip |
Ok, the |
|
As per #2210, |
I'm also interested in adapting |
Chiming in: After seeing It's too early to understand exactly where things will end up, but there is a decent chance that if In light on this, I think it would make sense for pants to lean into the zeitgeist, and embrace seamless |
Thanks for the input @BrendanJM ! This ticket is specifically about Pex adopting uv, which would be one way Pants could do so, but not the only way. I've just reopened pantsbuild/pants#20679 to discuss Pants using uv directly. Since your post references Pants, that might be a good place to cross-post it. |
Doh… I followed this issue from the pants issue, didn’t realize I ended up in a different project 🫠 |
FWIW, |
@astrojuanlu that's good to know, however not enough. I want to be clear. If someone wants to contribute support they are free to try, but there are many features Pex needs to continue to support (it never breaks existing users), including lock subsetting, |
If having Pex use UV is opt-in and does not become the new default, having it not support various options from the start is not a breaking change. Adding support for UV in Pex incrementally is an option thus, no? |
Yes, but I think no one here has any clue what that actually means. I would love someone to step up and wrestle with how much special case code they do or do not need to make this happen. I won't be getting to it personally for quite some time. There are many other items to chew through. |
@jsirois Could you expand on what distribution metadata uv doesn't emit? Maybe we can ask them to emit that metadata. |
@kuza55 I think my point is "we" need to dig in. If you want to get Pex using uv as an alternate resolver, you'll need to understand what data Pex gathers from Pip and how it patches Pip at runtime to support things like |
Let me sharpen this even more. IIUC there is not a desire to make Pex faster / better here, there is actually just a desire to get Pants performing better, and it happens to use Pex right now. Is that right? If so, does anyone here actually understand why Pants uses Pex? For example, the problem of sandbox construction latency for 10ks of files and the --layout packed affordance Pex makes for Pants to be able to handle this? Etc ... - I really think Pants folks need to understand what's going on before they can fix Pants let alone Pex. |
I'm going to go out on a limb and assume most people (like me) who are interested in pants improvements don't know all these details and don't really want to become experts in python packaging or build systems either but are struggling with slow lockfile generation in pants. From my perspective there are a bunch of blockers that have been mentioned, but uv is also making progress on some of these and I am happy to play telephone if that makes this any easier. Though it sounds like the issue here is not that uv doesn't support things, but that nobody actually wants to do the work here (myself included), which is a different place to leave this discussion rather than what uv does or does not support. |
@kuza55 I think the issue is both, but agreed the bigger issue is no one willing to step up. As I said above, I won't be getting to it any time soon. I have already worked hard enough on |
linking a couple related uv issues here for posterity: |
@benjyw with #2512 you can use any alternate resolver that can plop out the resolve as a set of dists. That's not
I've pushed back on folks not stepping in to do work. The same goes here, but its in a different project. Perhaps someone will feel more comfortable wading in over there. |
uv is a new resolver and installer written in Rust. It claims to be substantially faster than Pip at resolving (and installing, although that is less relevant to us). It also claims to expose a CLI interface compatible with
pip
, so it supposedly can be used as a drop-in replacement. It notably does not claim to generate the same resolves as Pip (it uses PubGrub as the underlying solver).See https://astral.sh/blog/uv for more.
uv makes some weighty claims, but we know from experience that the Python packaging ecosystem is messy, with many edge cases, ad-hoc behaviors, sharp edges, and de-facto standards that are not codified anywhere. It's as yet unclear how truly functional, or pip-compatible, uv is in real-world cases. So uv still requires substantial vetting by the community.
This ticket is to track and discuss the idea of embedding uv in Pex as an optional alternate resolver. We can evaluate potential benefits and drawbacks as uv gets more real-world usage, and if we see practical performance gains, before committing any effort to this.
The text was updated successfully, but these errors were encountered: