10 ms·
I gotta say, I feel pretty vindicated after hearing for years how Python’s tooling was just fine and you should just use virtualenv with pip and how JS must be
by hardwaregeek 11mo ago
I gotta say, I feel pretty vindicated after hearing for years how Python’s tooling was just fine and you should just use virtualenv with pip and how JS must be worse, that when Python devs finally get a taste of npm/cargo/bundler in their ecosystem, they freaking love it. Because yes, npm has its issues but lock files and consistent installs are amazing
- WesolyKubeczek 11mo agoI somehow had quite enough problems going from bundler 1.13 to 1.16 to 2.x some years ago. I’m glad we have killed that codebase with fire.
- gigatexal 11mo agothe thing is I never had issues with virtual environments -- uv just allows me to easily determine what version of python that venv uses.
- icedchai 11mo agopoetry gave us lock files and consistent installs for years. uv is much, much faster however.
- beeb 11mo agoI used poetry professionally for a couple of years and hit so many bugs, it was definitely not a smooth experience. Granted that was probably 3-4 years ago.
- icedchai 11mo agoI've occasionally run into performance issues and bugs with dependency resolution / updates. Not so much recently, but at a previous company we had a huge monorepo and I've seen it take forever.
- palm-tree 11mo agoI started using poetry abiut 4 years ago and definitely hit a lot of bugs around that time, but it seems to have improved considerably. That said, my company has largely moved to uv as it does seem easier to use (particularly for devs coming from other languages).
- teekert 11mo agoI always loved poetry but then I’d always run into that bug where you can’t use repos with authentication. So I’d always go somewhere else eventually. Some time ago I found out it does work with authentication, but their “counter ascii animation” just covers it… bug has been open for years now…
- IshKebab 11mo agoThe very first time I tried to use Poetry I ran into a bug where it couldn't resolve some simple dependencies. uv actually works.
- rcleveng 11mo agoand pip-compile before that. Agree that uv is way way way faster than any of that and really just a joy to use in the simplicity
- ShakataGaNai 11mo agoI have to agree that there were a lot of good options, but uv's speed is what sets it apart. Also the ability to have a single script with deps using TOML in the headers super eaisly. Also Also the ability to use a random python tool in effectively seconds with no faffing about.
- pydry 11mo ago>finally get a taste of npm good god no thank you. >cargo more like it.
- internetter 11mo agocargo is better than npm, yes, but npm is better than pip (in my experience)
- DemocracyFTW2 11mo agoAs someone who moved from Python to NodeJS/npm ~10yrs ago I can fully support that statement. Dissatisfaction with Python's refusal to get its dependency/package-management act together and seeing how reasonably the task is being dealt with by `npm`—notably with all its flaws—made me firmly stay with NodeJS. Actually virtualenv was for me another reason to keep my fingers out of whatever they're doing now over there in Python-land, but maybe `uv` can change that.
- morshu9001 11mo agoYeah but I want uv to be default first
- morshu9001 11mo agoBoth of these work
- anp 11mo agoMight be worth noting that npm didn’t have lock files for quite a long time, which is the era during which I formed my mental model of npm hell. The popularity of yarn (again importing bundled/cargo-isms) seems like maybe the main reason npm isn’t as bad as it used to be.
- no_wizard 11mo agonpm has evolved, slowly, but evolved, thanks to yarn and pnpm. It even has some (I feel somewhat rudimentary) support for workspaces and isolated installs (what pnpm does)
- WatchDog 11mo agoLock files are only needed because of version ranging. Maven worked fine without semantic versioning and lock files. Edit: Changed "semantic versioning" to "version ranging"
- bastawhiz 11mo ago> Maven worked fine without semantic versioning and lock files. No, it actually has the exact same problem. You add a dependency, and that dependency specifies a sub-dependency against, say, version `[1.0,)`. Now you install your dependencies on a new machine and nothing works. Why? Because the sub-dependency released version 2.0 that's incompatible with the dependency you're directly referencing. Nobody likes helping to onboard the new guy when he goes to install dependencies on his laptop and stuff just doesn't work because the versions of sub-dependencies are silently different. Lock files completely avoid this.
- kevin_thibedeau 11mo ago> you should just use virtualenv with pip This is the most insulting take in the ongoing ruination of Python. You used to be able to avoid virtualenvs and install scripts and dependencies directly runnable from any shell. Now you get endlessly chastised for trying to use Python as a general purpose utility. Debian was a bastion of sanity with the split between dist_packages and site_packages but that's ruined now too.
- whalesalad 11mo agoit's because so many essential system tools now rely on python, and if you install arbitrary code outside of a venv it can clobber the global namespace and break the core OS' guarantees. I do agree it is annoying, and what they need to do is just provide an automatic "userspace" virtualenv for anything a user installs themselves... but that is a pandoras box tbh. (Do you do it per user? How does the user become aware of this?)
- dragonwriter 11mo agoWhat they needed to do is allow side-by-side installs of different versions of the same distribution package and allow specifying or constraining versions at import time, then you wouldn't have the problem at all. But that's probably not practical to retrofit given the ecosystem as it is now.
- aunderscored 11mo agopipx solves this perfectly.
- zahlman 11mo agoFor "applications" (which are distributed on PyPI but include specified entry points for command-line use), yes. For development — installing libraries that your own code will use — you'll still generally need something else (although the restriction is really quite arbitrary).
- 11mo ago
- chrisweekly 11mo agoWebdev since 1998 here. Tabling the python vs JS/etc to comment on npm per se. PNPM is better than npm in every way. Strongest possible recommendation to use it instead of npm; it's faster, more efficient, safer, and more deterministic. See https://pnpm.io/motivation https://pnpm.io/motivation
- tracker1 11mo agoDeno is pretty sweet too... shell scripts that don't need a package.json or a node_modules directory for dependencies.
- chrisweekly 11mo agoYeah, Deno 2 is pretty compelling.
- Ant59 11mo agoI've gone all-in on Bun for many of the same reasons. Blazingly fast installs too. https://bun.sh/ https://bun.sh/
- ifwinterco 11mo agoI think at this point everyone on hacker news with even a passing interest in JS has heard of bun, it's promoted relentlessly
- trenchpilgrim 11mo agoI'm still meeting devs who haven't heard of it and get their minds blown when they replace npm in their projects. Every day is a chance to meet one of the lucky 10000: https://xkcd.com/1053/ https://xkcd.com/1053/
- fud101 11mo agoI avoided JS for the longest time because i wanted nothing to with node or npm. With bun, i'm finally enjoying javascript.
- globular-toast 11mo agoI've been using pip-tools for the best part of a decade. uv isn't the first time we got lock files. The main difference with uv is how it abstracts away the virtualenv and you run everything using `uv run` instead, like cargo. But you can still activate the virtualenv if you want. At that point the only difference is it's faster.
- caconym_ 11mo agoThere is nothing I dread more within the general context of software development, broadly, than trying to run other people's Python projects. Nothing. It's shocking that it has been so bad for so long.
- hardwaregeek 11mo agoNever underestimate cultural momentum I guess. NBA players shot long 2 pointers for decades before people realized 3 > 2. Doctors refused to wash their hands before doing procedures. There’s so many things that seem obvious in retrospect but took a long time to become accepted
- brailsafe 11mo ago[flagged]
- trueismywork 11mo agoPeople in Europe spents years with people dying due to heat stress before they discovered ACs....
- PaulDavisThe1st 11mo agoThis isn't really true. Heat stress deaths in Europe are comparitively rare, or were until urbanization and climate change became bigger factors.
- mk89 11mo agoI have used pip freeze > requirements.txt pip install -r requirements.txt Way before "official" lockfile existed. Your requirements.txt becomes a lockfile, as long as you accept to not use ranges. Having this in a single tool etc why not, but I don't understand this hype, when it was basically already there.
- icedchai 11mo agoThat works for simple cases. Now, update a transitive dependency used by more than one dependency. You might get lucky and it'll just work.
- bdangubic 11mo agoit won’t work of course, no one is that lucky :)
- mk89 11mo agoNot sure how uv helps here, because I am not very familiar with it. With pip you update a dependency, it won't work if it's not compatible, it'll work if they are. Not sure where the issue is?
- pridkett 11mo agoSimple for simple cases - but you update a dependency and that updates a dependency that has a window range of dependencies because one version had a security issue which causes you to downgrade three other packages. It can get complicated. The resolver in uv is part of its magic. https://docs.astral.sh/uv/reference/internals/resolver/ https://docs.astral.sh/uv/reference/internals/resolver/
- noosphr 11mo agoJavaScript has truly rotted the brains of software developers. You include the security patch of whatever your dependencies are into your local vetted pypi repository. You control what you consider liabilities and you don't get shocked by breakages in what should be minor versions. Of course you have to be able to develop software and not just snap Lego's together to manage a setup like that. Which is why uv is so popular.
- NaomiLehman 11mo agoconda was great to me
- ZhiqiangWang 11mo agominiconda
- NaomiLehman 11mo agoyup
- bastawhiz 11mo agoconda ruined my shell and never successfully worked for me. I guess YMMV
- NSPG911 11mo agohave you tried pixi for this?
- morshu9001 11mo agoAll my experience with Conda is from helping my friend nuke it off his laptop
- insane_dreamer 11mo agosame here; I now prefer uv but conda served us very well, and allowed us to maintain stable reproducible environments; being able to have multiple environments for a given project is also sometimes handy vs a single pyproject.toml
- odyssey7 11mo agoPython might have been better at this but the community was struggling with the 2 vs 3 rift for years. Maybe new tooling will change it, but my personal opinion is that python does not scale very well beyond a homework assignment. That is its sweet spot: student-sized projects.
- morshu9001 11mo agoImo the community should've rejected Python 3 and said, find a way to improve things without breaking everyone. JS managed to do it.
- pansa2 11mo agoThe community basically did reject Python 3, at first. Almost nobody used 3.0 / 3.1 / 3.2, to the point where I’ve seen them retconned as beta releases. Even then though, the core developers made it clear that breaking everyone’s code was the only thing they were willing to do (remember Guido’s big “No 2.8” banner at PyCon?), which left the community with no choice.
- morshu9001 11mo agoYeah I was in the middle of that and had to keep switching between versions because of how many things were Py2 only or Py3 only. Extra annoying how v3 changed random things like integer division that's mess you up if you forgot.
- Me001 11mo ago[dead]
- Spivak 11mo agoBut you are just using virtualenv with pip. It doesn't change any of the moving pieces except that uv is virtualenv aware and will set up / use them transparently. You've been able to have the exact same setup forever with pyenv and pyenv-virtualenv except with these nothing ever has to be prefixed. Look, uv is amazing and I would recommend it over everything else but Python devs have had this flow forever.
- dragonwriter 11mo ago> But you are just using virtualenv with pip. No, you aren't. > It doesn't change any of the moving pieces It literally does, though iyt maintains a mostly-parallel low-level interface, the implementation is replaced with improved (in speed, in dependency solving, and in other areas.) You are using virtual environments (but not venv/virtualenv) and the same sources that pip uses (but not pip). > You've been able to have the exact same setup forever with pyenv and pyenv-virtualenv except with these nothing ever has to be prefixed. Yes, you can do a subset of what uv does with those without prefixes, and if you add pipx and hatch (though with hatch you’ll be prefixing for much the same reason as in uv) you’ll get closer to uv’s functionality. > Look, uv is amazing and I would recommend it over everything else but Python devs have had this flow forever. If you ignore the parts of the flow built around modern Python packaging standards like pyproject.toml, sure, pieces of the flow have been around and supported by the right constellation of other standard and nonstandard tools for a while.
- Spivak 11mo agoRight, it's a reimplementation, a really good one, but it doesn't change how Python packaging and dev environments work mechanically. The PEP that would have actually changed Python packaging to be more like NPM (https://peps.python.org/pep-0582/ https://peps.python.org/pep-0582/) was rejected. > If you ignore the parts of the flow I don't get this, pip has worked with pyproject.toml since its standardization https://peps.python.org/pep-0621/ https://peps.python.org/pep-0621/. You don't need any constellation of tools, the only pieces that aren't provided by upstream is the version manager and the virtualenv manager. The new packaging flow has also worked with the authoritative pypa tools since their standardization https://peps.python.org/pep-0517/ https://peps.python.org/pep-0517/ https://peps.python.org/pep-0518/ https://peps.python.org/pep-0518/ https://peps.python.org/pep-0751/ https://peps.python.org/pep-0751/ Again, uv is great, I just think people are giving this one tool too much credit for the standardization process (that uv is an implementation of) that actually addressed Python packaging issues. Like for example uv run, that's all https://peps.python.org/pep-0751/ https://peps.python.org/pep-0751/
- Me001 11mo ago[dead]
- ForHackernews 11mo agoTo be fair, Poetry has done everything uv does for about a decade. uv is much faster, which is great, but lock files, integrated venv management, etc.
- silverwind 11mo agoYep, coming from poetry, uv is a pure speed increase with the same feature set.
- mbac32768 11mo ago> that when Python devs finally get a taste of npm/cargo/bundler in their ecosystem, they freaking love it. Because yes, npm has its issues but lock files and consistent installs are amazing I think it's more like Rust devs using Python and thinking what the fuck why isn't this more like rustup+cargo?
- jrochkind1 11mo agoYeah, python's tooling for dependency management was definitely not just fine, it was a disaster. Coming from ruby. However, I think uv has actually now surpassed bundler and the ruby standard toolset for these things. Definitely surpassed npm, which is also not fine. Couldn't speak for cargo.
- zellyn 11mo agoWhat weird shadow-universe do you inhabit where you found Python developers telling you the tooling was just fine? I thought everyone has agreed packaging was a trash fire since the turn of the century.
- morshu9001 11mo agoHackernews and also the official Python maintainers
- j45 11mo agoI feel a little like this too. My default feeling towards using python in more ways than I did was default no because the tooling wasn't there for others to handle it, no matter how easy it was for me. I feel uv will help python go even more mainstream.
- nateglims 11mo agoPersonally I never thought it was fine, but the solutions were all bad in some way that made direct venv and requirements files preferable. Poetry started to break this but I had issues with it. uv is the first one that actually feels good.
- zelphirkalt 11mo agoTooling like npm, cargo, and others existed well before uv came up. I have used poetry years ago, and have had reproducible virtual environments for a long time. It's not like uv, at least in that regard, adds much. The biggest benefit I see so far, and that is also why I use it over poetry, is that it is fast. But the benefit of that is small, since usually one does not change the dependencies of a project that often, and when one does, one can also wait a few seconds longer.
- temporallobe 11mo agoYep, working with bundler and npm for a decade plus has made me appreciate these tools more than you can know. I had just recently moved to Python for a project and was delighted to learn that Python had something similar, and indeed uv is more than just a package manager like bundler. It’s like bundler + rvenv/rvm. And inspired by uv, we now have rv for RoR!
- ThinkBeat 11mo agothere are severe problems with npm as well. It is not a model I hope is replicated.
- keyliejener 11mo ago[flagged]
- doright 11mo agoWhy did it take this long? Why did so many prior solutions ultimately fall flat after years and years of attempts? Was Python package/environment management such a hard problem that only VC money could have fixed it?
- stavros 11mo agoIt didn't, though? Poetry was largely fine, it's just that uv is so much faster. I don't think uv is that much different from Poetry in the day-to-day dependency management, I'm sure there are some slight differences, but Poetry also brought all the modern stuff we expected out of a package manager.
- morshu9001 11mo agoIt's not fixed quite yet because the default recommended way is still pip. And that's the same reason past attempts didn't work.
- zamalek 11mo agoI would dread cloning a python project more than I would C++, and was the sole purpose I made real effort to avoid the language entirely.
- paulddraper 11mo agopip lock?
- tiltowait 11mo agoI don't know, Poetry's existed for years, and people still use requirements.txt. Uv is great but isn't exactly unique in Python-land.
- wraptile 11mo agoYeah I use poetry, uv and requirements.txt - all great tools for their respective niches.
- RatchetWerks 11mo agoI’ve been saying this for years! JS gets alot of hate for dependency hell. Why? It’s almost too easy to add one compared to writing your own functions. Now compare that to adding a dependency to a c++ project
- brightball 11mo agoI tried Python for the first time after I’d been coding with multiple other languages for about 15 years. The environment, dependency experience created so much friction compared to everything else. Changed my perspective on Docker for local dev. Glad to hear it seems to finally be fixed.
- tyingq 11mo ago> but lock files and consistent installs are amazing Yes, though poetry has lock files, and it didn't create the same positive feelings uv does :)
- insane_dreamer 11mo agoother than being much slower than uv, conda has worked great for years I do prefer uv but it's not like sane python env management hasn't existed
- JEFFREYBURKE 11mo ago[dead]