Skip to content
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

Support uv as the resolver and installer #2693

Closed
2 tasks done
txchen opened this issue Mar 14, 2024 · 15 comments
Closed
2 tasks done

Support uv as the resolver and installer #2693

txchen opened this issue Mar 14, 2024 · 15 comments
Labels
⭐ enhancement Improvements for existing features

Comments

@txchen
Copy link

txchen commented Mar 14, 2024

Is your feature/enhancement proposal related to a problem? Please describe.

uv https://github.com/astral-sh/uv is extremely fast to install pip libs, it would be nice if pdm (install/sync) can optionally invoke uv instead of pip to make it faster.

Describe the solution you'd like

Add a pip backend option, and support uv.

Tasks

@txchen txchen added the ⭐ enhancement Improvements for existing features label Mar 14, 2024
@frostming
Copy link
Collaborator

There isn't pip in the backend.

We'll see if lockfile format can be standardized and only then we can consider uv.

@ericjmorey
Copy link

What does it mean to standardize a lock file?

@frostming
Copy link
Collaborator

The community and packaging team is making effort on this: https://discuss.python.org/t/lock-files-again-but-this-time-w-sdists/46593

@Mjboothaus
Copy link

Maybe a pdm-uv package/extension-- keep up the excellent work

@EtienneT
Copy link

EtienneT commented Jun 7, 2024

Maybe pdm could leverage just uv resolver. Like they mention in this blog post, it can be used only as a resolver with uv pip compile. The speed difference makes a really big difference in the day to day of a dev.

@frostming
Copy link
Collaborator

Maybe pdm could leverage just uv resolver. Like they mention in this blog post, it can be used only as a resolver with uv pip compile. The speed difference makes a really big difference in the day to day of a dev.

The way uv resolver works in a different way from PDM's. You must specify the target Python version and platform tags to resolve against, while PDM supports resolving for a wide range of environments.

@frostming
Copy link
Collaborator

frostming commented Jun 20, 2024

I recently came up with a rough plan to leverage uv as the resolver and installer. However it would bring a significant change to how cross-platform lockfile works. And ideally it can also solve #46

I expect it to be a change of large scale and I am not sure if I can make it able to opt in and out. It also depends on how much spare time I can invest in this work, so no promise but stay tuned.

@frostming frostming pinned this issue Jun 20, 2024
@frostming frostming changed the title Support uv as an alternative to pip Support uv as the resolver and installer Jun 27, 2024
@frostming
Copy link
Collaborator

frostming commented Jun 28, 2024

The change will be divided into two steps. First, we will support resolving dependencies for the given target platform and Python range combination(#46 resolved at this step), and the current cross_platform strategy will be deprecated at the same time. Next, introduce uv to produce that lock. The workload ratio of these two steps is approximately 1:2. Therefore, we still need 2 or more minor releases for this to be landed.

@o-moe
Copy link
Contributor

o-moe commented Jun 28, 2024

@frostming By deprecating cross_platform strategy, do you mean that the lock files aren't cross platform anymore?

@frostming
Copy link
Collaborator

frostming commented Jun 28, 2024

@frostming By deprecating cross_platform strategy, do you mean that the lock files aren't cross platform anymore?

Not by the way it is now. You must specify which platform and python range the lockfile is targeted. You can also specify several combinations(or matrix) in a single lockfile.

This will make it more smooth to move to the lockfile standard in the future(if it's gonna be a thing). Because from the discussions happened till now, the community is tend to adopt this approach.

@zhuwenxing
Copy link

@frostming
Hi, I just read a tweet https://x.com/bentomlai/status/1815380726482932107.
I would like to know how the uv is used. Is it integrated into PDM or used as a standalone CLI?

@ipfans
Copy link

ipfans commented Aug 3, 2024

@zhuwenxing This PR is not related to PDM tool itself. src/openllm/venv.py

@frostming
Copy link
Collaborator

An experimental uv integration has landed in the latest prerelease of PDM. Or you can try the in-development branch at #3144

@Super1Windcloud
Copy link

An experimental uv integration has landed in the latest prerelease of PDM. Or you can try the in-development branch at #3144实验性的 uv 集成已出现在最新的 PDM预发行版中。或者您可以尝试开发中的分支 #3144

*请问老哥什么时候发布到正式版当中, 现在的解析速度确实过于缓慢, 未来如果用rust或者go重写也是可以考虑 ,还有现在的init template 也不太完善

@prassanna-ravishankar
Copy link

An experimental uv integration has landed in the latest prerelease of PDM. Or you can try the in-development branch at #3144

looks like #3144 is merged and released. Does that mean this issue is resolved?

@frostming frostming unpinned this issue Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ enhancement Improvements for existing features
Projects
None yet
Development

No branches or pull requests

10 participants