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

Swap pip for uv #830

Open
1 task done
lmmx opened this issue Feb 16, 2024 · 3 comments
Open
1 task done

Swap pip for uv #830

lmmx opened this issue Feb 16, 2024 · 3 comments

Comments

@lmmx
Copy link

lmmx commented Feb 16, 2024

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Use case description

uv was just released (from the makers of ruff), and is substantially faster than pip, pip-tools, and virtualenv. This seems desirable to speed up serverless builds.

Proposed solution (optional)

Announcing uv: an extremely fast Python package installer and resolver, written in Rust.

uv is designed as a drop-in alternative to pip, pip-tools, and virtualenv.

With a warm cache, uv installs are near-instant. Here, it's > 75x faster than pip and pip-tools.

Source

The “drop-in” claim seems to suggest you might be able to just change the binary i.e. re-alias pip to uv pip

@pgrzesik
Copy link
Collaborator

Hey @lmmx - how do you imagine support for uv on the plugin level? As the plugin uses pip that is installed locally, I think "just" aliasing on your own should be enough, but maybe I'm missing some specific use cases. Please let me know what do you think 🙇

@Zer0x00
Copy link

Zer0x00 commented Mar 16, 2024

uv doesn't (yet) support the pip install -t flag with which you can specify a target directory.

This flag is used by this project to install the requirements into a cache directory or if you've disabled the cache to have the requirements under .serverless/requirements.

Zer0x00 ➜ /project $ uv pip install -t /project/.serverless/requirements -r /project/.serverless/requirements/requirements.txt

error: unexpected argument '-t' found

  tip: to pass '-t' as a value, use '-- -t'

Usage: uv pip install [OPTIONS] <PACKAGE|--requirement <REQUIREMENT>|--editable <EDITABLE>>

For more information, try '--help'.

@pgrzesik
Copy link
Collaborator

Thanks for sharing @Zer0x00 🙇 Unless there will be a very high demand for uv-specific support, I think the plugin shouldn't include anything specific for uv if the general plan for it is to be a drop-in replacement for pip with full compatibility.

If anyone is interested in having support for uv sooner, please vote on the issue with 👍 and/or write a comment below 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants