6 ms·
A lot of our core packaging development is now happening in uv [1]. Rye uses uv under the hood, so as we improve uv, Rye gets better too. E.g., we recently add
by charliermarsh 2y ago
A lot of our core packaging development is now happening in uv [1]. Rye uses uv under the hood, so as we improve uv, Rye gets better too.
E.g., we recently added support for "universal" resolution in uv, so you can generate a locked requirements.txt file with a single resolution that works on all platforms and operating systems (as opposed to _just_ the system you're running on). And Rye supports it too in the latest release.
[1] https://github.com/astral-sh/uv https://github.com/astral-sh/uv
---
I work on Rye and uv, if you have any questions :)
- vaylian 2y ago> I work on Rye and uv, if you have any questions :) How do you pronounce "uv"?
- crucialfelix 2y agoRhymes with bruv. London pronunciation
- batisteo 2y agoNo idea how a londonian prononces bruv. How about IPA?
- welpo 2y ago/bɹʌv/
- crucialfelix 2y agoHow do you notate that the v is aspirated? It's practically an f
- satvikpendem 2y agoLike the American pronunciation of "of".
- zanie 2y agoWe say "you - vee" :)
- satvikpendem 2y agoLike ultraviolet? What's the origin of the name?
- smnrchrds 2y agoDoes Rye/UV with universal resolution work properly with PyTorch, or does it suffer from the same issue as Poetry? https://github.com/python-poetry/poetry/issues/6409 https://github.com/python-poetry/poetry/issues/6409 https://news.ycombinator.com/item?id=39257501 https://news.ycombinator.com/item?id=39257501
- catwell 2y agoIt works properly with PyTorch. For what it's worth at $DAYJOB we switched from Poetry to Rye starting from version 0.15 (even before it supported uv) for that reason initially.
- smnrchrds 2y agoThat is encouraging to hear. I am curious specifically about the universal resolution feature that has been newly added. Poetry's issue is that it cannot properly resolve PyTorch's more complicated situation. I imagine Rye before this change would have used pip under the hood, so it would have worked as well as pip. I hope this still holds with the new under-the-hood changes.
- ipsum2 2y agoWhat's the relationship between uv and uvloop?
- Leynos 2y agoNone. "UV" was chosen because it is short and available.
- boffinAudio 2y agoHow is it available if libuv?
- ziml77 2y agoThey probably mean that it didn't conflict with other common executables. I guess it could be a problem if libuv ever includes an executable called uv, though I can't imagine how it would make sense for libuv to have an executable component like that.
- fire_lake 2y agoHow can you generate a universal lock file when some packages will query the running system in arbitrary ways during resolution?
- jvolkman 2y agoMost packages don't do that. You can get really far by assuming that all of a package's wheels have the same set of dependencies (maybe using environment markers), and that its sdist always returns the same list of dependencies (also maybe using environment markers). No, it's not perfect, but it's also what Poetry and PDM do as far as I know.
- charliermarsh 2y agoYeah that's right -- we make the assumption that all distributions for a given package will yield the same dependencies, similar to Poetry, PDM, and other tools. This is not strictly required by the standards, but it's very rare for it to be violated.
- hobofan 2y agoIt's rare, but in my experience it can still be very impactful and hindering adoption. E.g. that practice seems to be quite prevalent in a few high-profile pytorch packages, which caused our team a lot of pain when trying to enable reproducible cross-platform builds 1-2 years ago
- fire_lake 2y agoIndeed. I gave up on this and just build in Docker.
- VagabundoP 2y agoGreat work. I've switched to using Rye now as I used to have to occasionally setup a new computer to work on a project and it was always a complete pain (pyenv+venv+pip). Now its: * Install Rye, * Pull from Github, * Type rye sync
- pen2l 2y agoGiven that you guys are in charge of both uv and rye, why keep two alive at the same time? Why not just kill rye now to avoid fragmentation, and confusion that comes with the burden of having to choose between the two?
- rfoo 2y agoIIUC, uv is a replacement for pip (?), and rye is for pyenv+poetry.
- baggiponte 2y agoIn the end, uv will be the pyenv + poetry replacement, and supersede rye.
- arthur-st 2y agoAny ongoing work/plans to follow for cross-platform lock files? This is one concern that would prevent the team I'm on from moving. We do ML work, so I'll use a pytorch-based project for my example. The desired state is that all dependencies are in pyproject.toml, e.g., from which you can generate a set of lockfiles from an AArch64 Mac or an AMD64 Windows workstation for the following platform configurations: 1. Mac with default (MPS) pytorch 2. Windows with CUDA pytorch 3. AArch64 Linux with CPU pytorch 4. AMD64 Linux with CPU pytorch 5. AMD64 Linux with CUDA pytorch P.S. Big thanks for making Ruff, we're huge fans of linting and formatting both.
- arthur-st 2y agoI guess I'll add that this is mostly possible using a Docker-based workflow, but the hope is that one day we could get something more lightweight.
- HelloNurse 2y agoRequiring Docker implies that a packaging tool is too simplistic to do its job.
- arthur-st 2y agoWell, that's my question - I'm not familiar with Rye/uv, and I'm curious to know if it can substantively simplify the workflows that I'm aware of. I simply clarified to pre-empt a potential comment about Docker.
- LarsDu88 2y agoPoetry does cross platform lockfiles, but the absence of cross platform lockfiles is one of the reasons why uv benchmarks significantly faster (on top of using Rust for the resolve)
- arthur-st 2y agoUnfortunately, installing pytorch via Poetry was not for the faint of heart, last I tried. [1] For example, it used to download wheels for all matching distributions (say pytorch for a few platforms) to get metadata. That would be like a 10 GB download for 4 wheels of pytorch, to generate the lockfile. Another thing it used to do is ignore local cache, so for some locking operations would download the same wheel multiple times. In general, it was not entertaining, from an ML practitioner's perspective, to infer an attitude from the Poetry maintainers that the mountain shall come to Muhammad, so to say. Their abridged position was that pytorch is not compliant with standards, when Poetry itself, e.g., is not PEP 440-compliant, in a manner pertinent to the issue at hand. [2] I realise that my grumbling about pytorch has nothing to do with your perfectly adequate comment, that said. Please interpret it as nothing more than an expanded rationale fore being more interested in learning about Rye/uv than in revisiting Poetry, at least for the projects I've worked on. [1] https://github.com/python-poetry/poetry/issues/6409 https://github.com/python-poetry/poetry/issues/6409 [2] https://github.com/python-poetry/poetry/issues/7748 https://github.com/python-poetry/poetry/issues/7748
- germandiago 2y agoHow does it compare to Pipenv and Poetry? I had some problems every time I used Poetry. I wanted to like it but it hanged or took forever and similar things often.
- VagabundoP 2y agoSo dep resolution is fast with uv. Setting up a new project is: rye init && rye sync Adding a dep is: rye add flask && rye sync You can pin your python version in the pyproject.toml Migrating from an established project is a little hard than it should be. Importing the requirements.txt into the pyproject.toml is not a good idea as uv gets itself in a twist with all the low-level dependencies that exist in the requirements.txt. I've never tried it with a poetry made pyproject.toml, report back if you try it. On the whole its a good experience, fast and straight forward.
- andybak 2y ago> Importing the requirements.txt into the pyproject.toml is not a good idea as uv gets itself in a twist with all the low-level dependencies that exist in the requirements.txt. Can you explain? I wonder if you mean "requirements.txt generated via pip freeze" rather than "a human curated requirements.txt"
- VagabundoP 2y agoYeah you're right. If you just keep the requirements.txt "high level" then you should be okay. Just my experience with uv hanging for ages with a pip freeze made requirements file.
- Terretta 2y agoYou have a lot of firms that care about predictable and performant building that are shifting to you, and one of the things that comes up is SBOM generation for ingestion into tools like guac. https://guac.sh/ https://guac.sh/ https://pypi.org/project/sbom4python/ https://pypi.org/project/sbom4python/ https://github.com/CycloneDX/cyclonedx-python https://github.com/CycloneDX/cyclonedx-python Your recently added ability to unpin dependencies so devs are more encouraged to stay compatible as they dev, then generate a correct explicit requirements.txt for reproducibility, makes both vuln management and the SBOM step a far easier thing than poetry etc. Thank you! For similar reasons, we use https://hatch.pypa.io/latest/why/ https://hatch.pypa.io/latest/why/ and appreciate that it plays nicely with `uv`.
- crabbone 2y agoI like how you ignore the "best practices" for packaging created by PyPA (i.e project.toml and friends) and just do requirements.txt cowboy stuff. Don't get me wrong, both are hilariously bad, but I like to see more chaos in Python infrastructure. You pushing against PyPA (rightfully) delegitimizes them.
- timothylaurent 2y agoI assume this "Universal" resolution is enabled by adding the "--universal" cli argument? It doesn't look like this is currently documented but I found some hints in the release notes.
- OutOfHere 2y agoI can do this with pip-tools. Exactly how does one enable this in rye?
- jscheel 2y agoThis is awesome. I’ve really struggled with cross-platform resolutions in my bazel setup, as our services are built for containers that run in k8s, but we also want to be able to build and run locally for scripts, tests, etc. I have a branch that uses PDM, which works much better, but there are still a ton of hacks in it. Rye looks like it could help quite a bit.