13 ms·
Rye: A Hassle-Free Python Experience
- noisy_boy 2y agoI have a project managed by Poetry - how easy would it be to switch that to use rye? What are the upsides/downsides compared to Poetry?
- elbear 2y agoDo you have problems with Poetry? If not, don't switch
- JodieBenitez 2y agoThat's a sane comment here. Don't switch tools when a new one appears just because the new might be better. Switch tools when you actually have a problem with the current one and the new one solves that while not degrading the rest.
- andrei-akopian 2y agoXKCD 927 Yet another package manager? https://dublog.net/blog/so-many-python-package-managers/ https://dublog.net/blog/so-many-python-package-managers/
- yboris 2y agoNeat! A relevant quote: "[rye] has matured to the point where it now does most if not all of what poetry does only faster"
- stavros 2y agoHow are they doing this? A few months ago it was a replacement for pip, now they basically rewrote most of Poetry? In a few months? Let alone Ruff being a rewrite of like fifty tools. How is this even possible?
- ofek 2y agoI think you're thinking of UV, this is a project that they adopted. As far as I understand UV is where development is happening and actually Rye is soft deprecated.
- viraptor 2y agoIt's "just" a wrapper for the existing tools. If you're already using ASDF for your python versions and know how to use venv, there's not much gain here - saves a couple of simple commands only. It could replace your poetry (https://python-poetry.org/ https://python-poetry.org/) if you're using it though. Specifically, it doesn't do anything new/different by itself.
- canadianfella 2y ago[dead]
- odie5533 2y agoIt's all-in-one. Also mise > asdf.
- blooalien 2y agoSo much free advertising XKCD gets simply by being always relevant... :~P
- LarsDu88 2y agoI wrote the `so-many-python-package-managers` article and posted it earlier today. I'd like to apologize for misrepresenting `rye` in the first draft. I did not realize it had made so much progress in the span of the past year, and it really does look like an excellent tool. Certainly, with the `uv` backend, it just about fixes my one major gripe with `poetry` I'll be giving it a go on my next project! (Note: I updated my article just now to say more good things about `rye`)
- andrei-akopian 2y agoDon't worry, I didn't actually read your article (I read the first few pharagraphs) then I scrolled a bit, went "yeah, thats lots of package managers" and pasted it into my notes somewhere.
- LarsDu88 2y agoYup that's why I wrote it. It's basically my notes dump. Wait and see my next blog post. It's going to be about Genghis Khan and a paternity dispute.
- charliermarsh 2y agoThis is a very nice article, thank you for the kind words.
- LarsDu88 2y agoI mention you specifically! Thank you for your oversized contributions to the Python programming landscape. When I hear folks say you need an entire team to do X, Y, Z, I just point them to examples like Charlie Marsh!
- judge2020 2y agoObligatory https://xkcd.com/927 https://xkcd.com/927 and https://xkcd.com/1987 https://xkcd.com/1987 Probably not actually a large issue here since it uses pyproject.toml which is what Poetry uses and seems to be the standard people are moving to.
- sghiassy 2y agoObligatory indeed. No need to water it down - both are still highly relevant for python
- 1propionyl 2y ago> it uses pyproject.toml which is what Poetry uses and seems to be the standard people are moving to Yes, PEP 517 is standard now. But, that's not actually a build system and depending on how you configure it, the actual contents can differ wildly. While build-system.build-backend is standard, how one actually configures that backend in tools.<your-build-tool> are not standard at all. It's more proper to think of it as a standard meta-format for build system configuration. There is effectively no real portability between build/project tools except in the most absolutely trivial cases.
- ranyml 2y ago#1987 is actually outdated and way too small. Nowadays it should include build/install/pip/flit/rye/setup/setuptools/setuptools-deprecated/poetry/[insert 50 more build tools].
- galoisscobi 2y agoOn the introduction page: > Rye is still a very experimental tool, but this guide is here to help you get started. While I’m really excited about this project, I’m planning on waiting until this project is in a more mature stage. I am a big fan of everything else the Astral team has put out so I have high hopes for this.
- tamimio 2y agoIt looks interesting; I'll keep an eye on it. Side note: The intro video is great, but the keyboard clicks were annoying.
- spoonfeeder006 2y ago>Alternatively if you don't trust this approach, you can download the latest release binary Is there a security difference between running a shell script that runs a binary vs running a binary directly? Or downloading a executable from the browser vs downloading a shell script using curl? I get that running the shell script can subjectively look more scary, but doesn't it just basically reveal the inherent danger of running an exe anyhow, assuming there's no code signing keys involved?
- sammy2255 2y agoYou can virus scan a binary before running it
- fire_lake 2y agoAttackers can run a virus scan before distributing it.
- sammy2255 2y agonot sure what you’re getting at
- em-bee 2y agoattackers can check if a virus scan would detect the virus and change it until it passes the scans, so virus scans are not sufficient protection against dedicated attackers. just because a virus scan did not find anything in a binary, that doesn't mean the binary is safe.
- sammy2255 2y agoThats true but no sane malware developer would share their binary with VT. Downloading a binary is still safer than having your shell run arbitrary stuff
- rat87 2y ago
- geenat 2y agorequirements.txt daily reminder: you can specify exact commits from git repos.
- odie5533 2y agoYou should use pyproject.toml to specify loose constraints instead.
- Sparkyte 2y agobut why?
- otteromkram 2y ago[flagged]
- Sparkyte 2y agoI suppose but they could've just made a whole API on a homelab that is a resume to test against and for luls.
- simonw 2y agoIn case you're being serious, this very clearly wasn't a resume boosting project. Rye creator Armin has Flask, Jinja and Click on his resume (among many others) - it's stacked already.
- fbdab103 2y agoThe author's resume already stands above most. I think this is solving a real problem. Even the PSF, which frustratingly does not take a stance on the matter, is somewhat considering a very similar idea in PyBI.
- simonw 2y agoIf you're interested in the historical rationale for Rye I suggest reading the original README from when it was first released: https://github.com/astral-sh/rye/blob/8e430b0519fe2a125837e115e0001b3e71189a46/README.md https://github.com/astral-sh/rye/blob/8e430b0519fe2a125837e1... And Armin's later post about the vision for the project a year later: https://lucumr.pocoo.org/2024/2/4/rye-a-vision/ https://lucumr.pocoo.org/2024/2/4/rye-a-vision/
- Apreche 2y agoThe thing that put me off of Rye is that it strongly encourages you to use non-standard Python builds. From their philosophy page: https://rye.astral.sh/philosophy/ https://rye.astral.sh/philosophy/ > No Python Binary Distributions: CPython builds from python.org are completely inadequate. On some platforms you only get an .msi installer, on some you literally only get tarballs. The various Python distributions that became popular over the years are diverging greatly and cause all kinds of nonsense downstream. This is why this Project uses the indygreg standalone builds. I hope that with time someone will start distributing well maintained and reliable Python builds to replace the mess we are dealing with today. And here is info about those particular indygreg builds. https://gregoryszorc.com/docs/python-build-standalone/main/ https://gregoryszorc.com/docs/python-build-standalone/main/ It is, however, possible to choose a different Python. https://rye.astral.sh/guide/toolchains/ https://rye.astral.sh/guide/toolchains/ I've never really experienced the problem they are describing. Any official Python build I've gotten from python.org has worked. Every normal old Python I've gotten from my distribution's package manager has worked. Every Python included with an official Docker container image has worked. I'm sure their special builds will also work just fine, but their non-standardness gives me pause. There's even a list of behavior quirks. Why are we adding quirks to something that has no problems? And the fact that the rye philosophy seems so intent on using them, turns me off from it compared to the alternatives that sensibly default to using the Python you already have available on your OS.
- p5a0u9l 2y agoAgree. Support PSF, don’t advocate a new “right way” of doing it. Weird position.
- sghiassy 2y agoA new python dependency manager is like stumbling across a new JavaScript framework
- wqtz 2y agoMy philsophy is simple. If the program is intended to be distributable, just use Go. If it does not require port stuff, use docker. If you have an IT team or someone to hand you a computer with OS and Python version installed that everyone else in the org uses, use venv. If you have to work with ports, you have to distribute programs, or your libraries depend on C or OS stuff, then start consulting where you do not have to manage the codebase or have no committment to it after getting paid.
- dumbo-octopus 2y agoNone of the problems you pose should be of any issue to anyone who calls themselves a professional.
- dumbo-octopus 2y agoHilarious that this is being downvoted. Can you imagine professionals in any other industry being so pathetic? “Oh man, making bridges is sooo hard, I won’t stand by my work on anything that is above the ground. Making highways is sooo hard, I won’t stand by my work for anything that has to hold a lot of weight. Making food safely is soooo hard, I won’t stand by my work for anything that requires chilled storage and/or cooking to an appropriate temperature.” Grow up. Have some respect for yourself, your work, and the industry.
- mardifoufs 2y agoIt's more complicated to write machine learning software in go than it is to write portable apps in python. Same goes for a lot of uses cases for python outside of backend servers or similar web related use cases. You can't really just "use go" for a lot of the things people use python for, at least not realistically
- 1propionyl 2y agoRough edges as they may be, I'm just going to put my chips on Hatch because it works well, the defaults for build/formatting/testing/publication are sane and built on other tools, I can actually read the source code easily enough to PR it (which I have done), and it's under the auspices of the PyPA. In short, it's a good facade. Also, the CLI tooling doesn't even depend on using Hatchling as a build system, which is an understated benefit. Unless one's got a particularly weird use case where they actually need to know the ins and outs of PEP 517 (Maturin/PyO3 with system specific dependencies, for example) it is going to be completely fine for the vast majority of packages with minimal additional configuration.
- darkteflon 2y agoI’ve used both Hatch and Rye extensively. Hatch is great, but currently lacks monorepo support (it is expected to be added by the Autumn). I do like the way that Rye bootstraps itself, the dependency resolver does seem to be much faster, I like that you get updated pip lockfiles on every sync, and it already has opinionated monorepo support. Getting a new developer spun up is as easy as “rye sync”. But I agree that the fact that Hatch is under the auspices of the PyPA is persuasive indeed. Rye for some reason requires that you put dev dependencies under a non-standard key in pyproject.toml, but other than that, it’s pretty trivial to swap between Hatch and Rye as you like (which was indeed one of the primary goals of PEP621 afaiu). I for one will certainly be checking in on Hatch again when monorepo support is added.
- sean_pedersen 2y agoI like pixi (https://pixi.sh/latest/ https://pixi.sh/latest/). Let's me pin python version, install packages from conda and PyPI. And also written in Rust.
- dr_kiszonka 2y agoThanks for the link. Is it faster than conda?
- mvelbaum 2y agoyes
- ksquarekumar 2y agoIt's orders of magnitude faster than conda
- krageon 2y agoIt looks really interesting but it is hard to really invest in yet another ecosystem that tells you to curl and pipe into bash and then tells you to eval arbitrary command output.
- networked 2y agoFor what it's worth, you can install pixi with Cargo. The current invocation is: cargo install --locked --git https://github.com/prefix-dev/pixi.git pixi I try new versions of pixi from time to time because I have a project that depends on LAVIS and EasyOCR. My default project-management tool, Poetry, has problems with PyTorch. Right now, I use pip-tools for the project. While Conda worked, I didn't like the tooling that much. What is currently blocking me from using pixi is the PyPI integration (https://github.com/prefix-dev/pixi/issues/1295 https://github.com/prefix-dev/pixi/issues/1295). I can evaluate pixi in earnest when it is solved.
- KolenCh 2y agoI find pixi great. If anyone uses conda, pixi is a drop-in replacement where the environment is associated with the git/project directory, similar to devbox/devenv/flox. The story is a bit complicated. There was conda by the anaconda company written in Python. Then the open source ecosystem conda-forge is a conda channel with CI build bots. Then mamba being in the same umbrella under conda-forge is a drop-in replacement of conda written in C++ (this is actual drop-in that `alias conda=mamba` should work.) Then now conda uses libmamba as the solver to speed it up. Then the author of mamba spin it off to pixi, a rewrite in rust with different philosophy on how environments should be located and activated, with full compatibility with conda environments. Conda always supports installing packages from PyPI via pip (when it isn’t available from conda channels for example.) and pixi support PyPI packages via uv. That makes pixi fast. (There are other optimizations done outlined in their blog post making it much faster than even mamba.) If anyone uses any non-pure python packages, then conda is the way to go. Package manager choice (conda/mamba/pixi) is secondary. The problem with PyPI is the lack of gate keeping. That coupled with lack of standard way to package non pure python packages makes environments leaking (see comments on errors encountered in exotic or old environments), and/or non-reproducible (especially when people is distributing source only and doing crazy things in setup.py to bootstrap their environments including compilers.) In conda land, the conda-forge channel has pretty good gate keeping to ensure quality, such as being constrained properly, licensed properly (PyPI maintainers sometimes didn’t include the necessary license file in the distribution), environment isolated properly, etc. it’s not bullet proof as there is official bot that maintainers can use to auto-merge changes from PyPI that has wrong version constraints for example. The problems that no tools can solves right now are centered around PyPI: deal with packages not available in conda, and releasing packages virtually mandates releasing on PyPI first. When installing packages available on PyPI only through conda, there are some of its dependencies still available through conda. AFAIK, no package manager will use conda packages to fulfill the PyPI package dependencies. You can manually add the conda packages to resolve dependencies, risking not subjecting it to the right version constraints. And when you author an open source python package, even if your setup relies on conda channels only, you most probably would/need to release it on PyPI first (releasing on conda-forge channel virtually mandates a presence at PyPI first). Then you need non-conda tools to help you. This is why Rye would still be useful to people like me, and worth checking out.
- rattray 2y agoWe use rye to develop the openai-python library and it's been great.
- 1attice 2y ago[context: honest question from occasional Python user] What's wrong with poetry?
- sghiassy 2y agoIt doesn’t work consistently across environments
- 1attice 2y agoCould you explain futher? By 'environment' do you mean platform?
- sghiassy 2y agoLike during dev setup, does it work on your friends laptop but not yours, even though you’re both running MacOS latest (this was my experience) Or it works on your laptop but not a CI machine (also my experience). What we want is for a declarative toml file to reliably reproduce dependencies regardless… sadly even across very similar machines it fails to do so.
- cmcconomy 2y agoisnt this what the lockfile is for? are people installing poetry lock dependencies on macos that turn out different?
- mixmastamyk 2y agoProbably have different versions of Python installed manually. And/or architecture different.
- sghiassy 2y agoI’d recommend reading about Python Wheels - https://realpython.com/python-wheels https://realpython.com/python-wheels Unlike, say NPM, Python doesn’t just download a versioned set of python files depending on your lock file
- pen2l 2y agoWorth noting that the uv folks (https://astral.sh/blog/uv https://astral.sh/blog/uv) have taken over reins from this Armin project.
- 1attice 2y agoIronic that this just went by as well https://dublog.net/blog/so-many-python-package-managers/ https://dublog.net/blog/so-many-python-package-managers/
- drewda 2y ago> and most notably Rust has Cargo – quite possibly the most widely loved package manager tool in existence. I thought Rubygems was "the most widely loved package manager" given how often it's been used as inspiration for other languages' package management systems... but maybe I'm just getting old :)
- yboris 2y agoCounterpoint: directly from the article, a relevant quote: "[rye] has matured to the point where it now does most if not all of what poetry does only faster" So perhaps rye is all we need. I've been happy with pipenv before (letting me keep a list of dependencies and their versions in a file separate from the requirements.txt - so I can upgrade core dependencies rather than sub-dependencies). But I'll give rye a try next time I touch Python packages.
- ggm 2y agoI would think that making it manage musl/alpine first-class and not require a branch in the road to deal with it, was worth the effort. Things like this make it harder enough that people will do hacky modes of work to get around it. (I hit similar things with libressl/libcrypt from time-to-time. It is not quite exactly a drop-in replacement world for these things. It's painful enough to make back-porting modern SSL dependent code a royal pain, of destroyed shared lib dependencies)
- p5a0u9l 2y agoHere I am and pip+venv+pyproject.toml work just fine. I don’t distribute outside our team, maybe that’s why?
- chefandy 2y agoCross-platform applications that rely on binary libraries have always been the beginning of my Python dependency misery. It usually works fine, but when it doesn't, it's miserable.
- modeopfer 2y agoSame for me. Does rye help? Or what's your silver bullet?
- wormlord 2y agoPyInstaller + bundling the dlls and binaries works well for me
- chefandy 2y agoOne annoying problem that I encountered with that approach was different binaries having different version conflicts on different platforms. Not unsolvable, but definitely unsolvable without a whole lot of irritation, and a huge PITA to maintain. It definitely makes it possible though, which is a whole lot better than nothing.
- chefandy 2y agoI haven't encountered any silver ammunition for that particular gun. I haven't worked on a big python project in a while, so I'm not sure if rye would do the trick.
- p5a0u9l 2y agoI get that, but isn’t that a problem with dependency management itself and not the tools?
- 2y ago
- awinter-py 2y agotheir uv tool is incredible -- it is substantially faster than vanilla pip even on a fast laptop, and they were smart to adopt pip-tools commands for pinning will not go back to pipenv / poetry unless uv does something truly awful to me I feel more meh about rye, except as a way to use uv for package management and I don't understand why astral is a company
- andrewmcwatters 2y agovenv, pip, and requirements.txt are just fine.
- jvolkman 2y agoUnless you want reproducible installations on multiple platforms.
- odie5533 2y agocries in CI
- throwawaymaths 2y agoNo, they're not. Just teaching a beginner what the hell a venv is is a nightmare
- thomasfromcdnjs 2y agoI'm about 20 years into coding, and still don't "actually" know what a venv is haha
- andrewmcwatters 2y agovenv really doesn't seem meaningfully different than jenv or nvm to me.
- throwawaymaths 2y agoAlso bad. Modern languages have per-prpject dependencies.
- alexey-salmin 2y agoI don't mind venv and pip — they may be inconvenient but at least they work. The requirements.txt however is essentially broken for any project that changes in time. If you don't freeze transitive dependencies versions your builds break with no prior notice. If you do, transitive dependencies stay there forever even when not needed anymore.
- hdhshdhshdjd 2y ago$ nano thing.py $ python3 thing.py Don’t see the hassle there.
- odie5533 2y agoKeep reading the python tutorial you're working through and you'll eventually see they import 3rd party libraries. That's when things get difficult.
- hdhshdhshdjd 2y agoI keep my 3rd party libraries to a bare minimum as I actually know how to code. The time it takes to write a utility function is less than the long term pain of dependency hell and all this tooling. I suggest you go read through your CS 101 textbook.
- chefandy 2y agoSurely everyone working on codebases large enough to require package management has the flexibility to make unilateral architectural decisions and re-solve problems a battle-tested library already solved, having mitigated all of the counterintuitive edge cases and security holes you haven't discovered yet. Well, maybe not, but please, please don't let reality discourage you from vigorously patting yourself on the back for not being stymied by limitations that weren't imposed on you.
- chefandy 2y ago- Open piano - Push keys in the correct order If you forget what order to push the keys, it's literally written on the sheet in code easy enough for young children to decipher. I don't understand the kerfuffle.
- hdhshdhshdjd 2y agoYes, you don’t need a concert hall, a grand piano, or a team of recording engineers to push a key. You are correct.
- barakm 2y agoWow, so many haters :( I love Rye. It does what it says on the tin. It makes the whole venv/Python-version/packaging process actually pleasant, and it’s invisible to someone used to Python-official usage (pyproject.toml et al). And it makes Python feel like Cargo, which is a great thing to work with too.
- dilawar 2y ago> Python feel like cargo I am sold. Was thinking of trying out pixie after poetry took whole day and still couldn't resolve deps. Looks like there are more python package managers that chat apps from Google ?
- ericjmorey 2y agoPixi is limited in focus to the Conda ecosystem within Python's ecosystem. Rye is not quite what Cargo is to Rust, it's more like a faster Poetry. Both Rye and Pixi are using uv, which aspires to close the gap for Python packaging tools to be the Cargo of Python. Rye will likely fold into UV at some point in the future.
- amingilani 2y ago> poetry took whole day and still couldn't resolve deps. I hate doing this, but the solution is to reduce the search space for poetry to find a compatible version. Verbosely install with poetry (-vvv) and note the package it gets stuck on. Find the currently installed version from the lock file and specify it as the minimum in your pyproject.toml file. The time to find a solution went from 2-4 hours to <90 seconds when I did this a few months ago for a large complex work project.
- bbor 2y agoI was going to complain, but I’ll ask you/yall instead: what do you mean “makes it actually pleasant”? Is it too hard to summarize? Because I don’t think I ever identified anything about Anaconda or Poetry that felt like a particular choice, at least UX-wise. And curation-wise, it seems like a hard sell to trust a smaller org over the larger established group. In other words: what does it say on the tin?? All I can read is “good package manager is good because good and fast and good”. Maybe there’s a comparison or ethos page…
- pnathan 2y agoconda works really well for local hacking. Whatever it does, it sidesteps almost all the other footguns I have encountered with local pythons. on the other hand, I've found Go to be meaningfully superior for many things, and Rust to be meaningfully superior for many other things, and Scala excellent for the JVM and I simply can't actually recommend other languages for professional greenfield work outside of exceptionally niche cases.
- tonymet 2y agoguys just use matrioshka.py it is your one-stop package management system for python. just prefix any other package manager with matrioskhka e.g. python -m matrioskha rye install pip install pipx setup.py install A single distribution command for all of your projects.
- sali0 2y agoThe cynicism of HN surprises me sometimes. I love Rye. After using package managers from other languages like cargo and hex, the lack of a similar system for Python always had me yearning for more. I'm really happy to say Rye has completely solved this itch for me, and its a real pleasure to use as someone who doesn't want to install different tools to manage venvs, python versions and my project's dependencies. Rye just does it all.
- thrdbndndn 2y agoHave you tried conda? How is it compared to Rye? I haven't had an idea of Rye yet, but conda can do "manage venvs, python versions and my project's dependencies" fine.
- pkage 2y agoML researcher perspective: Conda is... dog slow, even for relatively simple tasks (clone and run a project). The recommendation nowadays is to use Mamba (iirc), but in my experience (a few years old now) it's been unstable and unable to find package solves which worked on my system / our cluster. I've settled on just using Poetry for most things, and then using pip in a venv to install the pyproject.toml file from Poetry either in a Dockerfile or directly on a cluster. That's worked fairly well so far, even with torch/cuda (and the mess of CUDA versioning) and from macOS to Linux. I think uv/rye is a good next step, Poetry can be a bit slow as well at times.
- thrdbndndn 2y agoIt IS slow, no argument there, but I never find the speed of a package management tool too important. Maybe it's different for other ecosystem such as node etc., but when I'm doing research in ML I config my project mostly just once and do the bulk work (install cuda pytorch etc.), later it's mostly just activate and occasionally add some util packages via pip. What makes conda better than native venv+pip is its extensive libraries/channel and be able to solve/build complicated dependencies effortlessly especially when you have to run your project on both Windows and Linux. This is not to say speeding up isn't needed, of course!
- charliermarsh 2y agoA 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 :)
- 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?
- 2y ago
- est 2y agoI recommend Rye because of its python bianries (credit to Indygreg). What a time saver!
- mjfl 2y agoHassle isn't really what I think of when I think of Python. C++, yes, but not Python.
- Drygord 2y agoInstead of creating solutions to problems we create… Why don’t we just stop creating those problems =p
- bongodongobob 2y agoWho needs it. I install everything globally and then when some dependency fucks it all up I just reinstall the OS. Been meaning to learn the venv thing but I've been doing this for years and there's no turning back now. My workflow works for me.
- langcss 2y agoThis would have been not totally insane pre containers and using VirtualBox and just reimaging.
- xeromal 2y agohttps://news.ycombinator.com/item?id=40905891 https://news.ycombinator.com/item?id=40905891 * Python has too many package managers *
- benrutter 2y agoI don't disagree, but the trouble is, which do you axe? Everyone agrees there's too many, but nobody yet agrees what to converge on. It's probably made worse by the fact that package management isn't considered part of the python core team's remit. There's a github issue on the Rye page for "Should Rye exist?" for exactly that reason, and Armin (the original developer) seems pretty consious of the package manager clutter. But in all honesty, it solves a real problen that exists (that other package managers don't solve) so I can't see any reason Rye should do anything differently just because there are lots of package managers that currently exist.
- poulpy123 2y agoI would say it's the job of the people making python to select or provide a better solution than the current one
- bmitc 2y agoI wish people would just stop using Python for large projects. It's such a terrible language and ecosystem with a huge surface area of gotchas.
- JodieBenitez 2y agono we won't
- riwsky 2y ago“There should be one, and preferably only one, obvious way to do it—xor it’s packaging”
- fermigier 2y agoI'm still using Poetry for dependency management, but that will most probably change someday (hopefully with automated conversion of the pyproject.tml files). I'm OK with the pythons that are provided my the OS I'm using (including Deadsnakes) so this side of rye doesn't appeal to me. I've started using uv to create virtualenvs, though, so that's probably the gateway drug. We'll see.
- mvelbaum 2y agoWhile we're on this topic: 1. Can anyone recommend a good file layout/organization for a polyglot monorepo that contains Python, C++, and JS? 2. Does the build system need to be use something like Buck/Bazel? 3. How do you usually open your project in an IDE? do you open the root of the monorepo, or do you open each subproject separately?
- rtpg 2y agoRye has been wonderful for me. Works so nicely and isn't adding too many opinions. Things like poetry tend to really be not amenable to certain workflows, which has likely made many people stick around to `pip -r requirements.txt`.
- jari_mustonen 2y agoAs a Mac user, I'd be interested if you could add: * Installation through Homebrew * Plugin for Oh My Zsh!
- rat87 2y agoRye installs as a shell script you pipe to bash curl -sSf https://rye.astral.sh/get https://rye.astral.sh/get | bash (I believe this downloads the correct binary for you. Rye is a single binary built in rust but it will also download a version of Python to use for some operations) or you can download a zipped tar file from https://rye.astral.sh/guide/installation/#installing-rye https://rye.astral.sh/guide/installation/#installing-rye https://rye.astral.sh/guide/installation/#add-shims-to-path https://rye.astral.sh/guide/installation/#add-shims-to-path Oh-My-Zsh: mkdir $ZSH_CUSTOM/plugins/rye rye self completion -s zsh > $ZSH_CUSTOM/plugins/rye/_rye Then make sure rye plugin is enabled in ~/.zshrc I think the ZSH_CUSTOM would be your ohmyzsh folder
- fetzu 2y agoI am starting to wonder if I’m the only one that just types “brew install NameOfThatThingTheyWantMeToPipeInFromCurl” into my terminal as a reflex. It’s already available: https://formulae.brew.sh/formula/rye#default https://formulae.brew.sh/formula/rye#default
- richrichie 2y agoPretty cool. Would be nice to have Cython handling.
- wodenokoto 2y agoIf I'm not building a shared library, what is the benefit of having my project as a package? It seems Rye only supports python packages, but most my stuff never touches PyPI or anything similar.
- thelastbender12 2y agoFor that use-case, you can set up a `virtual project` using Rye. And use it just to create python envs, and sync dependencies. Honestly, the biggest time-saver for me has been Rye automatically fetching python binaries that work everywhere, and setting up clean venvs. - https://rye.astral.sh/guide/virtual/ https://rye.astral.sh/guide/virtual/
- benrutter 2y agoRye is a python only thing, and if you're using python without any external dependencies, it probably doesn't have that much benefit (although it does make having different python versions for different projects a lot cleaner if you need that). I think that it has a huuuuge benefit for applications as well as libraries. Rye generates lock files, which are really handy for pinning down versions of something running in production so that it'll behave predictably.
- wodenokoto 2y agoI am using external dependencies I’m just usually not packaging my project.
- ttyprintk 2y agoSome OSes need shims to easily call scripts on the command line. Also, you can define multiple entry points that might live in one big ol file.
- deleted 2y ago[deleted]
- hallqv 2y agoHow does it differ from Poetry
- kelvie 2y agoOne that that isn't clear is editor support -- I recently switched to poetry for a few repos at work because it took the pain out of editor setup for my team -- it works with intellij, vscode, and emacs (well, doom emacs made it pretty easy) -- anyone know how well this integrats with e.g. emacs? A quick search turned up this unanswered question: https://github.com/astral-sh/rye/issues/888 https://github.com/astral-sh/rye/issues/888
- VagabundoP 2y agoI use it with vscode and I've not had any problems. vscode just sees the environment. Rye puts things in standard places (PEP places) and uses common tools under the hood, so I think that it should generally just work with an editor that understands python environments.
- jimmcslim 2y agoIf I want to dip a toe in and run Rye and pyenv side-by-side on the same machine (not for the same project obviously)... is that going to be a footgun? I'm assuming... yes, since the shims from both are going to conflict? Update: looks like this might be supported, from the FAQ... Can I use Rye Alongside Other Python Installations? Rye given it's experimental nature does not want to disrupt already existing Python workflows. As such using it alongside other Python installations is intentionally supported. Even if the Rye shims come first on the PATH, Rye will automatically resolve to a different Python installation on the search path when invoked in a folder that contains a non Rye managed project. As such the answer is a clear yes!
- _ZeD_ 2y agowhat do rye offers to a pdm-based project? https://pdm-project.org/ https://pdm-project.org/
- MaximilianEmel 2y agoWhy should I use this over Miniconda?
- globular-toast 2y agoI'm not sure about Rye, but I've been experimenting with uv as a replacement for pip-tools and so far I'm impressed. I've been using and contributing to pip-tools for years now but it has a few quirks that I don't like. uv seems to solve them already, and it's way faster. There's a few bits I don't like in uv, but I intend to submit patches soon. The one thing I think sets these projects back is the naming. Rye, uv... They just aren't as good names as pip, pip-tools, venv etc. This could make it harder to convince people of their legitimacy. But I could be wrong, maybe they will succeed based on their merits. A "Cargo for Python" I find a bit misleading. Python is very different to Rust and upon learning Rust I didn't find anything that I hadn't already got in all my Python work. If anything Cargo is just 'the best parts of all packaging software so far, including Python".
- prmoustache 2y agoJust watched the video introduction. I don't mind people preferences regarding keyboard kind, but those noisy mechanical keyboards sounds awful, tiresome and downright aggressive when watching a recording as they stand out and sound a bit like a machine gun in an FPS. I don't need that kind of aggression, especially when it is so loud it is covering the voice of the presenter. I would appreciate it if people doing videos presentation would switch to quieter keyboard, use directionnal microphones so that only their voice is recorded or edit the sound afterwards to quiet down the keyboard frequencies out of respect to their audience. It is not hard to do.
- 037 2y agoFunny, I realized within the first few minutes that I’m not interested in Rye, but I couldn’t stop watching because I loved the mechanical keystroke sounds so much. I don’t use a mechanical keyboard for various reasons (I tried), but those sounds… (Not saying having them in the video for everyone is a good thing—I respect the fact that some people can find them annoying)
- prmoustache 2y agoWell you are perfectly entitled to watch ASMR videos of people typing on a loud keyboard :D I personnally do like a mechanical keyboard and the sound of them when I am using it, but don't use it much unless I am the only one at home out of respect to my kids and partner, especially in the morning[1]. And I would also switch keyboard to record a video or do a videocall as I don't want the sound of it to be so present. I think this is just a negative point on a video as it makes a busy foreground sound over what looks like a bad microphone recording in the background. That should be the opposite, the voice should be the foreground sound to your ears. [1] partner has irregular work schedule so might want to sleep longer in the morning when came late the night before.
- emblaegh 2y agoIs this a common opinion? After watching the video I couldn't imagine why anyone would be so bothered by the keyboard sounds in it, which is maybe just a little bit too loud? And way less distracting than the bad sound quality of the microphone used (which again, is pretty easy to get over).
- Paul-Craft 2y agoVery interesting! I will definitely try this out. Out of curiosity though: is there anything like this that exists, but less Python-specific?
- TekMol 2y agoMy world is really simple and I wonder if I am missing anything: 1: I develop and run Python projects in Docker containers. 2: Each Python project has a setup.py. 3: The setup.py installs dependencies from their git repos. What benefit would I get from using any additional tools?
- ModernMech 2y agoWell... why are you using Docker?
- TekMol 2y agoWithout containers, how do you prevent some dependency going rogue or bonkas and messing with files outside of the project directory?
- cap11235 2y agoNix would be another option. I find it odd so many tools like this are so Python specific, when a lot of the complexity is dealing with non-Python dependencies (glibc versions, and all the different C shared libs).
- SOLAR_FIELDS 2y agoI think there's room for both. I want speed and correctness within my little Python ecosystem, so I reach for a tool like Rye to help with the package management. Then to solve the system level issue maybe I reach for a simple direnv implementation to install the system level dependencies needed for the project. You could of course lean all the way in and manage and build your Python dependencies using Nix as well, but that is... introducing a lot more complexity and slowness at this time. I think it comes down to the frequency at which we iterate on things and the level of expertise required to deal with them. The system level dependencies might change much more rarely, and require more expertise to work with tooling, but if I can hand off a clean system environment to a developer who doesn't know about or need to care about Nix at all and then they are able to quickly iterate inside the Python ecosystem I get the best of both worlds - I solve the non-Python dependency problem myself and the end user (the developer) has a fast, smaller scoped, way less inscrutable problem to deal with when they are working within the Rye ecosystem.
- prmoustache 2y agoPresentation shows that if you decide to fix a python-version in a .python-version file, rye sync will not work and complain, and you will have to fetch it manually with `rye fetch <version>`. I am wondering why the developers chose not to propose to fetch the missing version when doing `rye sync`. I would expect anyone preparing the video tutorial to think "wait, this is stupid, let's fix this asap" instead of showing off potential users how unfriendly the ux is.
- scoresmoke 2y agoRuff and uv are both excellent tools, which are developed by a VC-backed company, Astral: https://astral.sh/about https://astral.sh/about. I wonder what their pitch was.
- ranyml 2y agoAnaconda competitor? Many companies in this space start out by releasing new OSS tools and then turn into consultancy sweatshops.
- mekkkkkk 2y agoRye-powered Python deployment platform a la Vercel?
- rmholt 2y agoThat's what I'm worried about. What if we start using Rye, bake it into our projects and then Astral goes "Sike! Now we will collect all information available to the Rye binary and require 1$ for each build"
- ranyml 2y agoWhy is the installation binary? Conda pulls the same shenanigans, which I hate. Why should I trust a self-extracting shell archive? I only install Conda on untrusted machines.
- chrisjj 2y ago> The windows installer normally will automatically register the rye path in the PATH environment variable. If this does not work Why would it not work?
- Ennea 2y agoI have not yet tried Rye, but the installation guide shows me that it's yet another (seemingly new, too) tool that creates yet another folder in the user's home directory (as opposed to ~/.config or ~/.local/share). Why?
- networked 2y agoIt looks like Armin Ronacher answered this question in the issues when he was maintainer (https://github.com/astral-sh/rye/issues/316#issuecomment-1589476529 https://github.com/astral-sh/rye/issues/316#issuecomment-158...): > While I understand the desire for XDG, I personally hate it because it encourages common files to be in different locations on different operating system, driving up the complexity for everybody. Once you go down that path, every single documentation has to explain different paths for different platforms and configurations, how different configs can affect where stuff is. It gets gnarly quickly. > I do not believe the benefits outweigh the downsides and XDG is generally not enough of a standard that it prevents people from putting stuff into the home folder. If you want to relocate `rye` there, you can already do by exporting `RYE_HOME`.
- datadeft 2y agoThe amount of effort that goes into making Python usable is insane.
- robertlagrant 2y agoQuestion about the company Astral: how does it make money? I see it has backers, and a mission, and beliefs, but is there something that's sold?
- LarsDu88 2y agoIt's kind of ironic that there isn't a decent business model for folks who build tools that uplift the productivity of MILLIONS of devs. I'll just say that even though Linux is FOSS, RedHat still became a multi-million dollar company. Likewise Travis Oliphant was able to build things like Anaconda and Quantsight to monetize some of these essential open source tools. With wide enough adoption, almost anything can be monetized at some level.
- robertlagrant 2y agoThere is a decent business model. There are several, in fact. I'm asking which Astral has, if any.
- ivirshup 2y agoI don't think it makes money yet. They've said the eventual plan is services [1]. [1]: https://astral.sh/blog/announcing-astral-the-company-behind-ruff#whats-next https://astral.sh/blog/announcing-astral-the-company-behind-...
- jwmoz 2y agoConfused with uv/rye
- ixxie 2y agoHow experimental is it? Should we use it for production for small app deployments? We are open to the cutting edge, but it can't be too sharp or rough.
- thomasfromcdnjs 2y agoOh this is incredible. As a non python developer, I never understood why python projects has a terrible DX. Say what you want about npm/node, but it's super easy to bootstrap a project and to understand what dependencies are required. Is there a reason why Python has taken this long to get a mature alternative to "requirements.txt"?
- trallnag 2y agoAre you claiming rye came up with the first mature alternative? Tons of people have been using solutions like Poetry for years. Don't discredit that.
- ModernMech 2y agoI think it's just in Python's DNA. I dunno, even going back to the Python 2/3 debacle, it's just one language and ecosystem I've never felt "has it together". Despite being a language for beginners, I've never felt it especially easy to use.
- bityard 2y ago> Say what you want about npm/node, but it's super easy to bootstrap a project and to understand what dependencies are required. Huh? JavaScript is legendary for having a near-infinite amount of ever-changing frameworks and "build" systems, with various overlapping abilities.
- vinceguidry 2y agoMy favorite ecosystem, Ruby, has an order of magnitude less issues in this regard, so you can imagine my sadness to discover my second tech love, Emacs, is just absolutely unreal in this regard. And there's just no way around it, I wish I could hack on Emacs in Ruby, but there appears to be no way around learning elisp. And elisp is... crufty, to say the least. At least the documentation is really good once you get past all the beginners issues. And there's a refreshing self-awareness there, fun seeing 'this function has been around since around Emacs 23' when looking stuff up.
- verdverm 2y ago> desire to establish a one-stop-shop for all Python users, Rye provides a unified experience to install and manages Python installations This seems an impossible task on linux, where yum/apt packages are installed long before any higher-level python tools like poetry or rye. With the continual sprawl of "one tool to rule them all" in Py & Js, I'm thankful for Go being a much more consistent ecosystem.
- rmholt 2y agoRye isn't aiming to replace apt. Rye is just aiming to do the same as Go, having one tool to manage dependencies. In current ecosystem there are many many different tools tho manage Python project's dependencies unfortunately.
- verdverm 2y agoRye is never going to replace apt. There are too many system dependencies and people do not want to deal with multiple package managers in most cases. I suspect even within Python, there will never be one tool. Go is materially different, because it is the language and tooling wrapped into one. Python would have to have the solid tooling built into the CLI, so that we don't feel the need for tools like Rye to begin with. Python is already too fractured to ever realize this, imho. We have been moving away from python packagers towards linux packagers because it is trivial to mirror them internally. We do this because external mirrors have been unreliable and we have full control over when updates get rolled out without having to pin every version (the mirror effectively pins them)
- cbenz 2y agoruff, then uv, then rye All of them changed my pythonist everyday life, one after another. Great thanks to all the team.
- jekude 2y agoRye looks great (i've also really enjoyed using Poetry as well). But man, do I have respect for Go's quality of out-of-the-box tooling. Feels like every time I start a Python project I need to re-learn the state-of-the-art wrt dependency/venv management.
- ericfrederich 2y agoWhy Rust? Aren't you alienating Python devs from working on it? I see that UV is bragging about being 10-100x faster than pip. In my experience the time spent in dependency resolution is dwarfed by the time making web requests and downloading packages. Also, this isn't something that runs every time you run a Python script. It's ran once during installation of a Python package.
- ModernMech 2y agoI'm not sure of the answer, but one thing Rust has obviously bought them is native binaries for Mac/Windows/Linux. For a project that purports to be about simplicity, it's very important to have an onboarding process that doesn't replicate the problems of the Python ecosystem.
- extr 2y agoIf you are building a production app that uses python in a containerized way, you may find yourself rebuilding the containers (and reinstalling packages) multiple times per day. For us, this was often the slowest part of rebuilds. UV has dramatically sped it up.
- dgellow 2y agoIt runs every time you build a docker image or build something in your CI
- ericfrederich 2y agoso it take 3 seconds to run instead of 0.3? Don't get me wrong, that's a huge improvement but in my opinion not worth switching languages over Features should be developed and tested locally before any code is pushed to a CI system. Dependency resolution should happen once while the container is being built. Containers themselves shouldn't be installing anything on the fly it should be baked in exactly once per build.
- verdverm 2y agoModern CI can also cache these dependency steps, through the BuildKit based tools (like Buildx/Dagger) and/or the CI itself (like GHA @cache)
- phgn 2y agoCould you publish it on Homebrew to make the installation on Mac hassle-free too?
- fetzu 2y agoIt already is: https://formulae.brew.sh/formula/rye#default https://formulae.brew.sh/formula/rye#default
- maCDzP 2y agoI read in another thread that people are doing dev in a container. It’s supposed to be awesome. How does this compare do developing inside a container?
- mark_l_watson 2y agoI read this thread early this morning and have been trying Rye for the first time over the last several hours. I like it and a few things have helped: 1) add a Makefile targets for auto-creating a requirements.txt file to make my two new projects play well with pip, etc. for people not wanting to use Rye. 2) ChatGPT saved me time setting up VSCode and Emacs for Rye+Python dev. So far, I love Rye! So fast and no roadblocks yet.
- ris 2y agoI thought they "really going to get it right this time" N-1 python packaging tools ago. (happy Nix user)
- nextaccountic 2y agoCan Rye work with Conda projects?
- johnisgood 2y agoNot to be confused with Rye, the programming language: https://ryelang.org https://ryelang.org
- DanielKehoe 2y agoI'm sure experienced Python developers will continue to use the familiar pyenv/venv/pip toolset, or its many variations. However, Rye is better for beginners and developers coming from other languages. First, Rye is an all-in-one tool, written in Rust for speed, with a unified set of commands for setting a Python version and installing packages, with environments created automatically. Second, the tool uses a folder/project approach to development like languages such as JavaScript and Ruby, where a developer sets up a project in a folder and then specifies a language version and dependencies, rather than the old Python approach where packages get installed into a Python version that is shared among projects (unless a virtual environment is created with venv). The Rye documentation is good, still I thought it's good to offer a tutorial for beginners, so I wrote "How to install Python on Mac" [0] and "How to use Rye for Python" [1]. I don't know if Rye will catch on, but it's a breath of fresh air. [0] https://mac.install.guide/python/install https://mac.install.guide/python/install [1] https://mac.install.guide/python/use-rye https://mac.install.guide/python/use-rye
- JodieBenitez 2y agoI kinda like that it downloads its own interpreters... could be useful when using pyinstaller to have a more portable interpreter.