-
-
Notifications
You must be signed in to change notification settings - Fork 469
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
Better uv integration #668
Comments
Is there a config option to start using rye with uv instead of pip today? |
@brunorpinho # When set to `true` enables experimental support of uv as a replacement
# for pip-tools. Learn more about uv here: https://github.com/astral-sh/uv
use-uv = false This was also asked during the installation and I have been using it and testing it out today. No real heavy testing, but it works great for me so far. |
Note that for this to work on windows you need the not yet released version as it's disabled for safety reasons on windows still since I did not have time yet to verify basic functionality. |
One that might be worth including here for feature completeness is the dependency overrides functionality. A common complaint with The overrides functionality in uv could be a fairly lightweight way to bypass this whilst all the repos are in active development. |
Does using I have the following on my [[tool.rye.sources]]
name = "pytorch"
type = "index"
url = "https://download.pytorch.org/whl/nightly/cu121" The lastest stable release of torch is Does not work: ❯ rye add torch
Added torch>=2.2.0 as regular dependency Does not work: ❯ rye add --pre torch
Added torch>=2.2.0 as regular dependency Seems like rye is constructing a similar command argument as the following. Based on the ❯ VIRTUAL_ENV=.venv uv pip compile --no-deps --no-header --python-version 3.11.7 --prerelease=allow -
torch
Resolved 1 package in 1.54s
torch==2.2.0 But if try to install directly with uv, it does work: ❯ uv pip install torch --prerelease allow --index-url https://download.pytorch.org/whl/nightly/cu121
Resolved 22 packages in 570ms
Downloaded 11 packages in 28.06s
Installed 22 packages in 117ms
+ filelock==3.9.0
+ fsspec==2023.4.0
+ jinja2==3.1.2
+ markupsafe==2.1.3
+ mpmath==1.2.1
+ networkx==3.0rc1
+ nvidia-cublas-cu12==12.1.3.1
+ nvidia-cuda-cupti-cu12==12.1.105
+ nvidia-cuda-nvrtc-cu12==12.1.105
+ nvidia-cuda-runtime-cu12==12.1.105
+ nvidia-cudnn-cu12==8.9.2.26
+ nvidia-cufft-cu12==11.0.2.54
+ nvidia-curand-cu12==10.3.2.106
+ nvidia-cusolver-cu12==11.4.5.107
+ nvidia-cusparse-cu12==12.1.0.106
+ nvidia-nccl-cu12==2.19.3
+ nvidia-nvjitlink-cu12==12.1.105
+ nvidia-nvtx-cu12==12.1.105
+ pytorch-triton==3.0.0+901819d2b6
+ sympy==1.11.1
+ torch==2.3.0.dev20240219+cu121
+ typing-extensions==4.8.0 |
@sbarrios93 yes, looks like a bug. I will fix that. |
@mitsuhiko, I'm assuming that a fix would involve setting the default source in I've added some insights specific to PyTorch in astral-sh/uv#1723, which I closed in favor of astral-sh/uv#1451. I don't want to hijack this thread – let me know if it's better to open a separate issue for this discussion. |
Installing with
|
This at the very least is triggering a weird code path in Could be trivially worked around on the rye side though if needed. |
Thank you for looking into it. There is no more panic with |
Not sure if this is the right place, but I can't figure out an easy way to get rye (with uv enabled) to update my rust deps.
With uv enabled, I get the following:
Where proj-entrypoint & proj-toolbox are rust crates & proj depends on both of them. |
Will It's needed when clone some projects which not init by rye |
@geoqiao Rye init already supports importing requirements files Edit: Indeed, as you say, it seems like it's not documented. |
I'll suggest here that uv's --offline flag could be made available on rye lock and rye sync. |
Sorry, I didn't find in doc. Could you teach me how to do that? Thanks! |
Thanks for your reply, I found the -r option in the command line section of the document |
The `build` package supports uv since version 1.2.0 - it can use either uv or pip as installer. The main way to use it would be to install `build[uv]` but rye already has uv installed separately, build will find it on the path as a fallback, so this can work for rye. build is implicitly tested by test_publish. Relates to #668
Friendly ping. Is there any way to pass
but alas, I cannot seem to pass this option through to uv. |
@MilesCranmer - I can look into adding it. Note that you can work around this by telling
As long as you include some pre-release segment in the specifier, we'll enable pre-releases for that dependency. |
Awesome. Thanks! |
@MilesCranmer have you had any success using rye sync --pre ? |
Yep, that did it, thanks! (Unfortunately it was a dependency of a dependency, so putting it as an explicit dependency wasn't optimal) Maybe the error message could point out the |
Thanks for the hint. I found that the |
This is a meta task to look into actually leveraging
uv
properly.requires-python
rather than the current venv version--prerelease
options available--resolution
modes availableThe text was updated successfully, but these errors were encountered: