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

option to use uv #1959

Closed
mbway opened this issue Feb 25, 2024 · 7 comments · Fixed by #2015
Closed

option to use uv #1959

mbway opened this issue Feb 25, 2024 · 7 comments · Fixed by #2015
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mbway
Copy link
Contributor

mbway commented Feb 25, 2024

It may be beneficial to offer uv as a backend for maturin develop rather than hard-coding pip as the only available backend.

I was thinking about this while thinking of ways to speed up the import hook tests as a significant part of those tests is waiting for maturin develop. Compilation still probably takes the majority of the time but there may be a small benefit.

uv pip offers a pip-compatible interface for installing packages but may be faster than using pip. Since it's written in rust perhaps it could be bundled into maturin directly as a library?

@mbway mbway added the enhancement New feature or request label Feb 25, 2024
@messense
Copy link
Member

I'm in favor of add support for it, but I don't want to bundle/link it into maturin directly given that it's not stable yet (we don't want to release a new version of maturin everytime uv makes a new release) and will increase compile time and binary size for maturin.

Call uv pip in subprocess should be fine.

cc @konstin

@konstin
Copy link
Member

konstin commented Feb 26, 2024

A --uv option would be great! As messense said this should use the uv pip cli, as uv doesn't expose a stable rust interface.

@messense messense added the good first issue Good for newcomers label Mar 22, 2024
@dmatos2012
Copy link
Contributor

from the comments it seems clear how it should look like , so I would like to give this one a try if ok with everyone :)

@messense
Copy link
Member

@dmatos2012 Thanks!

@nleroy917
Copy link

Hey guys, I might be missing something, but this is what I see when I run maturin develop --uv:

error: unexpected argument '--uv' found

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

Usage: maturin develop [OPTIONS] [ARGS]...

Then trying with maturin develop -- --uv, yeilds:

error: Unrecognized option: 'uv'

I am using the latest maturin (I believe):

Package    Version
---------- -------
maturin    1.5.1  
tomli      2.0.1  

@nleroy917
Copy link

Just now occurring to me that this might not be released yet.

@bluenote10
Copy link

Nice to have this feature implemented! @nleroy917 Looks like it is released in maturin 1.6.0

Out of curiosity: Is there also a way to configure the usage of uv via the config, so that it is not necessary to pass --uv along with each command line invocation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants