CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 474
Rye and uv #1342
Replies: 25 comments · 61 replies
-
The new UV features look great! |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 5
-
That's a good idea. There are a few things we definitely don't support yet:
|
Beta Was this translation helpful? Give feedback.
All reactions
-
π 2 -
π 3
-
The shim can be tracked at astral-sh/uv#6265 |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 2 -
β€οΈ 3
-
Rye's |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 4
-
@charliermarsh do you plan to include something like Rye's |
Beta Was this translation helpful? Give feedback.
All reactions
-
We do yes: astral-sh/uv#5903 |
Beta Was this translation helpful? Give feedback.
All reactions
-
β€οΈ 1
-
Update: Since Does As best I can tell from the CLI reference, the answer is no, but it's not completely clear. The relevant passage I found after quite a bit of searching is:
Relatedly, I feel like your docs need some adjustment after version 0.3 and to make them easier to navigate (when looking for this kind of info, at least). The docs on project management (project concepts, projects guide) are not trivial to find, and it's hard to guess before reading them which of them (if either) will have the needed info. After reading them, they do not seem to address the question (I could have missed the answer hiding somewhere, though; I also haven't experimented with it yet and things might become clearer once I do). Rye is a good example to follow for clear docs. It is easier for |
Beta Was this translation helpful? Give feedback.
All reactions
-
Perfect, thank you! |
Beta Was this translation helpful? Give feedback.
All reactions
-
Fixed: astral-sh/uv#6291 |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 2 -
β€οΈ 1 -
π 4
-
For people coming to this discussion now, uv 0.4 made significant improvements and changes to the virtual package/no-code package feature set: https://github.com/astral-sh/uv/releases/tag/0.4.0 |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 2 -
π 1 -
π 1
-
Still continuing my migration to Has |
Beta Was this translation helpful? Give feedback.
All reactions
-
Yeah we removed the virtual concept in favor of βprojects that arenβt packagesβ. The app flag to uv init will create a project that uv will not treat as a package, so it wonβt be built and installed into the environment, like Ryeβs virtual workspace root concept. |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1 -
π 1
-
FWIW: the most alarmingly great thing about rye is that it works just as good on windows (many python things don't work good on windows). My place of work develops for rhel and windows, so having both "work good" is crucial. |
Beta Was this translation helpful? Give feedback.
All reactions
-
I am a bit worried that you plan to make people switch from rye to uv eventually. The confusion has some potential to end both projects. (Perl 6 as the most egregious example.) Have you considered for the future to simply rename |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1 -
π 2
-
@shamrin my original goal was (unless a better plan emerges) to have a "final" release of |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 27 -
β€οΈ 9
-
Probably a bit lower on your list, but we use the polylith plugin for rye to make our monorepo setup work: https://github.com/DavidVujic/python-polylith-example-rye apart from the nice tooling the polylith CLI offers, key functionality and setup here is:
I am not a rust programmer, so maybe this is all already covered by the workspaces concept? |
Beta Was this translation helpful? Give feedback.
All reactions
-
β€οΈ 1
-
I'm happy to hear about the Polylith usage! I have begun to look into the workspaces feature of uv (and I guess also Rye), and how it can be combined with the Polylith tooling. |
Beta Was this translation helpful? Give feedback.
All reactions
-
β€οΈ 1
-
following here @DavidVujic, we also use polylith and appreciate the work you put in to make it easier to use. |
Beta Was this translation helpful? Give feedback.
All reactions
-
β€οΈ 1
-
I think Edit: Uv now does this for uv init --app --package |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1 -
β€οΈ 1
-
+1 As it currently stands, starting from
All you technically need to do to make your project executable is to add
to the
But would be nice if there was a |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1
-
Rye's support for Rust modules out-of-the-box is quite nice. It was something that I'd love to see get even more love. Any chance uv will focus on supporting this as well. It enhances both languages considerably I feel, if that friction is removed in what's likely a future standard too. I'd like to be able to have a python directory with notebooks (a la Zed repl) inside my rust repos and be able to setup rust in my python repos to add code easily. And I think reducing that friction would bring a lot to the table. (Nice work on supporting single-file scripts, btw. I'm looking forward to that coming out of nightly in Rust for the 2024 version.) |
Beta Was this translation helpful? Give feedback.
All reactions
-
This seems to work by adding the following lines to the pyproject.toml file (as rye does): [build-system]
requires = ["maturin>=1.7.0"]
build-backend = "maturin"
[tool.maturin]
python-source = "python"
module-name = "my_project._lowlevel"
features = ["pyo3/extension-module"] |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1
-
A maturin template is now implemented in uv and will be in the next release. |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 2 -
π 2 -
π 1
-
I just migrated from rye to uv. It was relatively straightforward - got most of the way there by replacing [tool.rye] with [tool.uv] in pyproject.toml The docker build required slightly more changes because previously I was copying in rye's Likewise the github action was straightforward to set up by following the guide as well. |
Beta Was this translation helpful? Give feedback.
All reactions
-
β€οΈ 2
-
One thing I would add to the Docker guide is to run |
Beta Was this translation helpful? Give feedback.
All reactions
-
Is there any doc available for migrating from rye to uv? |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 5
-
Really excited to make the switch to uv! Thanks for all the great work :) If I understood the docs about dependencies and alternative indexes correctly, I can only specify the source for a specific dependency and I could set [[tool.rye.sources]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cpu" I have a bunch of dependencies from my own index and it would be cool to just include it as an additional source like I can do with rye. Or are there some bad consequences when doing that? Would be interested if someone else would like this feature. |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 2 -
β€οΈ 1
-
Yeah that's correct -- we only support the pip-like |
Beta Was this translation helpful? Give feedback.
All reactions
-
β€οΈ 2
-
This is a very important feature for anything related to GPU compute (language models etc.) where libraries like |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1
-
I'm in the same boat and this would be quite valuable to me. Similarly we are looking forward to index pinning |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1
-
On Linux, the thing that has stopped me the most from updating Python has been the worry of accidentally overwriting my system Python. I want to install every major point release, and keep them updated. I also would potentially like to try out new beta versions if needed, but I want all of these installs to be easily discovered within PyCharm, even with new projects. It seems like Rye might allow this (or a subset) via |
Beta Was this translation helpful? Give feedback.
All reactions
-
See the |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1
-
I haven't migrated to using It looks like Currently the only think missing is something that works like the |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 2
-
This is what is preventing it from becoming globally available to PyCharm? Basically this shim would be just like downloading Python from the official source and installing it in the correct directory (to not override system python)? |
Beta Was this translation helpful? Give feedback.
All reactions
-
It's worth noting that both Rye and uv install portable builds that deviate somewhat from what you'd get from a distro package manager or building from source (such as via pyenv). You can read about those builds and their quirks here. The shim feature enables automatic and transparent use of different versions of Python in different shell contexts. That can be per folder and/or globally. Shims only affect users who enable them, so anything root or other users do with system Python will be unaffected. Pycharm has its own feature for using different Python versions with different projects. That should work with any solution for getting different Python builds, be it uv, Rye, pyenv, or something else. You just need to know the paths. |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1
-
Does In particular, because |
Beta Was this translation helpful? Give feedback.
All reactions
-
Looks like this has just been added, many thanks! https://x.com/charliermarsh/status/1829620595048468480 |
Beta Was this translation helpful? Give feedback.
All reactions
-
Build and publish? Or have I missed something? |
Beta Was this translation helpful? Give feedback.
All reactions
-
Definitely on the short-term roadmap. Documented as not supported at https://docs.astral.sh/uv/guides/publish/ We're tracking at astral-sh/uv#6278 / astral-sh/uv#1510 |
Beta Was this translation helpful? Give feedback.
All reactions
-
Would uv support commands like |
Beta Was this translation helpful? Give feedback.
All reactions
-
(not a direct answer to your question, but for those worried about losing (Or you could install |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1
-
I really want In Rust, I can open a project, and run |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 16
-
From my perspective, Currently, If compatibility must be considered, perhaps btw, I completely understand the desire to escape the never-ending decisions around toolchains (especially since I sometimes have to do front-end work, and the front-end toolchain is a real nightmare). However, in my case, mandating the use of ruff hasn't actually eased the debates within my team. We still argue over whether boolean parameters should be allowed, whether it's okay to write error messages directly inside parentheses, and whether assert statements should be permitted. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Plus one for |
Beta Was this translation helpful? Give feedback.
All reactions
-
Will uv support rye.virtual configuration? I'm not sure there is a configuration that will accomplish the same thing. I don't want to install the project itself into the environment. |
Beta Was this translation helpful? Give feedback.
All reactions
-
I think you can since |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1
-
I personally use Rye to build wheels and publish them to pypi ( |
Beta Was this translation helpful? Give feedback.
All reactions
-
They are planning to support both |
Beta Was this translation helpful? Give feedback.
All reactions
-
β€οΈ 1
-
A low hanging fruit is that |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 3
-
There's an open PR for this thankfully: astral-sh/uv#5476 |
Beta Was this translation helpful? Give feedback.
All reactions
-
β€οΈ 1
-
For me, aside from liking the python shim (which somebody else has mentioned) the main thing stopping me from swapping to uv (from rye) is for team projects where rye is working well, the different locations for dev dependencies in It's kinda caused by python not having a standard dev requirements protocol, but it would be amazing for some kind of magic setting to tell uv "no actually look at this section for dev requirements instead". |
Beta Was this translation helpful? Give feedback.
All reactions
-
(even better would be if the python community standardised on a way of capturing dev requirements, but that's probably a lot harder to achieve as a single project than a settings option π ) |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 2
-
Guess what, they did, and it's done! ππ» PEP 735 β Dependency Groups in pyproject.toml |
Beta Was this translation helpful? Give feedback.
All reactions
-
I just found out rye and uv, and from the conversation, it seems rye and uv have both its pros and cons, and uv being under development, may potentially replace rye(?)... So should i start using uv directly? I only need for basic python packages, not yet building large scale projects... |
Beta Was this translation helpful? Give feedback.
All reactions
-
If only |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1
-
I tried migrating from
|
Beta Was this translation helpful? Give feedback.
All reactions
-
|
Beta Was this translation helpful? Give feedback.
All reactions
-
π 3
-
One of the last features I needed was to generate a I understand that this is not yet supported. |
Beta Was this translation helpful? Give feedback.
All reactions
-
build and publish are available in uv now π |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1
-
And uv export can generate requirements files -- with dev, without dev, only dev, etc. |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1
-
Is there a doc for migrating from rye to uv? It should be a relatively simple process, but would still be good to have instructions |
Beta Was this translation helpful? Give feedback.
All reactions
-
No doc, but really - just place dev-dependencies under [tool.uv] instead of [tool.rye] (didn't need any other settings from there) and then run |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 2
-
Also, if that helps, I wrote a simple tool to migrate from rye to uv and I am planning to keep track on the different changes. |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1
-
@jgeralnik I replaced [tool.rye]
managed = true
virtual = true
dev-dependencies = [
"ruff>=0.5.5",
"pytest>=8.3.2",
] Any suggestions ? |
Beta Was this translation helpful? Give feedback.
All reactions
-
@mandarvaze, you should be able to replace |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 3
-
@lucianosrp Thanks. The error went away after making changes suggested by you. |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1
-
I think that uv compared with rye, uv's function and feature is more simple and practical |
Beta Was this translation helpful? Give feedback.
All reactions
-
The feature of generating the project layout for pyo3 is very important to meβit was almost the sole reason I switched from poetry to rye. Some of my work-related projects are highly performance-sensitive, and pyo3 provides significant benefits. However, before using rye, I couldn't find a tool that allowed me to initialize a project in under 30 seconds. By the way, Iβve been using uv to manage my experiments because its locking mechanism is simple, intuitive, and fast.If uv had better support for pyo3, I would have switched to uv without hesitation. |
Beta Was this translation helpful? Give feedback.
All reactions
-
This is available now: |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 2
-
I think that uv and rye docs should point to some of their differences and overall goal. I was a bit confused on why they were developing two projects, and which one should I use, specially because the homepage of each tools describe them as the same thing. rye:
uv:
The only answer is from astral blog which I doubt developers will read or even find.
Letting developers know uv is the intended successor should cause less problems in the future. EDIT: I want to clarify that the docs should contain that information and not hidden behind blogs. |
Beta Was this translation helpful? Give feedback.
All reactions
-
If rye becomes a progressively thin layer to uv while maintaining its functionality, that won't be so bad either. |
Beta Was this translation helpful? Give feedback.
All reactions
-
If Maintainer asked this:
Why not just announce Speaking clearly and firmly can avoid many problems. |
Beta Was this translation helpful? Give feedback.
All reactions
-
It is the intended successor. I think this has been fairly clearly stated. e.g. from Armin https://lucumr.pocoo.org/2024/8/21/harvest-season/ |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1 -
β€οΈ 1
-
The great feature I thought rye has is the string interpolation for index URL in |
Beta Was this translation helpful? Give feedback.
All reactions
-
Hard-coding index URLs and setting the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
π Since we took over stewardship of Rye in February, we've been continuing to maintain the project and ship releases, but have been primarily focused on new feature development over in uv.
Rye uses uv under-the-hood, so it's also benefited from those changes (e.g., Rye's universal mode is powered by uv's universal resolver).
With the release of uv 0.3.0, uv is capable of supporting more and more Rye-like workflows. For example, uv can now download Python for you, generate lockfiles via
uv lock
anduv sync
, and so on.We don't plan to deprecate Rye any time soon, but our goal has always been to maintain it while we develop uv into a viable alternative. I suspect that uv can now replace Rye for some use cases, but I'm interested in hearing from Rye users: what is uv missing that would stop you from switching over? Where should we focus, if our goal is to enable smooth transition for Rye users in the future?
Beta Was this translation helpful? Give feedback.
All reactions