pdm
pdm copied to clipboard
Support uv as the resolver and installer
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
- [ ] https://github.com/pdm-project/pdm/pull/2995
- [ ] Introduce uv as the installer
There isn't pip in the backend.
We'll see if lockfile format can be standardized and only then we can consider uv.
What does it mean to standardize a lock file?
The community and packaging team is making effort on this: https://discuss.python.org/t/lock-files-again-but-this-time-w-sdists/46593
Maybe a pdm-uv package/extension-- keep up the excellent work
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.
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.
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.
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.
@frostming By deprecating cross_platform
strategy, do you mean that the lock files aren't cross platform anymore?
@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.
@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?
@zhuwenxing This PR is not related to PDM tool itself. src/openllm/venv.py
An experimental uv integration has landed in the latest prerelease of PDM. Or you can try the in-development branch at #3144
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 也不太完善
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?