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
caconym_|4 months ago
hardwaregeek|4 months ago
tomaskafka|4 months ago
Multicomp|4 months ago
UV is making me give python a chance for the first time since 2015s renpy project I did for fun.
zelphirkalt|4 months ago
One could argue, that this is one difference between npm and such, and what many people use in the Python ecosystem. npm and cargo and so on are automatically creating lock files. Even people, who don't understand why that is important, might commit them to their repositories, while in the Python ecosystem people who don't understand it, think that committing a requirements.txt only (without checksums) is OK.
However, it is wrong, to claim, that in the Python ecosystem we didn't have the tools to do it right. We did have them, and that well before uv. It took a more care though, which is apparently too much for many people already.
acomjean|4 months ago
lacker|4 months ago
lynndotpy|4 months ago
intalentive|4 months ago
the__alchemist|4 months ago
Honorable mention: Compiling someone else's C code. Come on; C compiles to a binary; don't make the user compile.
luckydata|4 months ago
zippergz|4 months ago
jkercher|4 months ago
Guess which part of the build I spent fixing the other day... It wasn't the ~200000 lines of c/c++ or the 1000+ line bash script. No. It was 100 lines of python that was last touched 2 years years ago. Python really doesn't work as a scripting language.
TheCondor|4 months ago
kristopolous|4 months ago
LtWorf|4 months ago
dataflow|4 months ago
RobertoG|4 months ago
mk89|4 months ago
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|4 months ago
kstrauser|4 months ago
rtpg|4 months ago
Pips solver could still cause problems in general on changes.
UV having a better solver is nice. Being fast is also nice. Mainly tho it feeling like it is a tool that is maintained and can be improved upon without ripping one’s hair out is a godsend.
pnt12|4 months ago
- dev dependencies (or other groups) - distinguishing between direct and indirect dependencies (useful if you want to cut some fat from a project) - dependencies with optional extra dependencies (if you remove the main, it will delete the orphans when relevant)
It's not unachievable with pip and virtualenvs, but verbose and prone to human error.
Like C: if you're careful enough, it can be memory safe. But teams would rather rely on memory safe languages.
2wrist|4 months ago
tecoholic|4 months ago
selcuka|4 months ago
That being said, the uv experience is much nicer (also insanely fast).
[1] https://pip.pypa.io/en/stable/user_guide/#constraints-files
12345hn6789|4 months ago
ghusto|4 months ago
FuckButtons|4 months ago
avidphantasm|4 months ago
ifwinterco|4 months ago
epage|4 months ago
unknown|4 months ago
[deleted]
chrisweekly|4 months ago
Ant59|4 months ago
https://bun.sh/
tracker1|4 months ago
nullbyte|4 months ago
anp|4 months ago
no_wizard|4 months ago
It even has some (I feel somewhat rudimentary) support for workspaces and isolated installs (what pnpm does)
WatchDog|4 months ago
Maven worked fine without semantic versioning and lock files.
Edit: Changed "semantic versioning" to "version ranging"
globular-toast|4 months ago
jrochkind1|4 months ago
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.
icedchai|4 months ago
beeb|4 months ago
no_wizard|4 months ago
Funny how these things get forgotten to history. There's lots of prior art when it comes to replacing pip.
edit: here's an HN thread about pipenv, where many say the same things about it as they are about UV and Poetry before https://news.ycombinator.com/item?id=16302570
rcleveng|4 months ago
Agree that uv is way way way faster than any of that and really just a joy to use in the simplicity
ShakataGaNai|4 months ago
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.
ForHackernews|4 months ago
silverwind|4 months ago
odyssey7|4 months ago
morshu9001|4 months ago
Me001|4 months ago
[deleted]
zelphirkalt|4 months ago
RatchetWerks|4 months ago
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
gigatexal|4 months ago
j2kun|4 months ago
mbac32768|4 months ago
I think it's more like Rust devs using Python and thinking what the fuck why isn't this more like rustup+cargo?
brightball|4 months ago
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.
doright|4 months ago
morshu9001|4 months ago
stavros|4 months ago
Spivak|4 months ago
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|4 months ago
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.
unknown|4 months ago
[deleted]
tiltowait|4 months ago
wraptile|4 months ago
temporallobe|4 months ago
And inspired by uv, we now have rv for RoR!
nateglims|4 months ago
j45|4 months ago
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.
tyingq|4 months ago
Yes, though poetry has lock files, and it didn't create the same positive feelings uv does :)
zamalek|4 months ago
zellyn|4 months ago
morshu9001|4 months ago
pydry|4 months ago
good god no thank you.
>cargo
more like it.
internetter|4 months ago
morshu9001|4 months ago
insane_dreamer|4 months ago
I do prefer uv but it's not like sane python env management hasn't existed
ThinkBeat|4 months ago
NaomiLehman|4 months ago
bastawhiz|4 months ago
insane_dreamer|4 months ago
ZhiqiangWang|4 months ago
WesolyKubeczek|4 months ago
paulddraper|4 months ago
JEFFREYBURKE|4 months ago
[deleted]
Me001|4 months ago
[deleted]
keyliejener|4 months ago
[deleted]
kevin_thibedeau|4 months ago
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.
ElectricalUnion|4 months ago
With PEP 723 and confortable tooling (like uv), now you get scripts, that are "actually directly runnable", not just "fake directly runnable oops forgot to apt-get install something sorta runnable", and work reliably even when stuff around you is updated.
zahlman|4 months ago
This wasn't really the case; in principle anything you installed in the system Python environment, even "at user level", had the potential to pollute that environment and thus interfere with system tools written in Python. And if you did install it at system level, that became files within the environment your system package manager is managing, that it doesn't know how to deal with, because they didn't come from a system package.
But it's worse now because of how many system tools are written in Python — i.e., a mark of Python's success.
Notably, these tools commonly include the system package manager itself. Since you mentioned Debian (actually this is Mint, but ya know):
> Now you get endlessly chastised for trying to use Python as a general purpose utility.No, you don't. Nothing prevents you from running scripts with the system Python that make use of system-provided libraries (including ones that you install later with the system package manager).
If you need something that isn't packaged by your distro, then of course you shouldn't expect your distro to be able to help with it, and of course you should expect to use an environment isolated from the distro's environment. In Python, virtual environments are the method of isolation. All reasonable tooling uses them, including uv.
> Debian was a bastion of sanity with the split between dist_packages and site_packages but that's ruined now too.
It's not "ruined". If you choose to install the system package for pip and to use it with --break-system-packages, the consequences are on you, but you get the legacy behaviour back. And the system packages still put files separately in dist-packages. It's just that... doing this doesn't actually solve all the problems, fundamentally because of how the Python import system works.
whywhywhywhy|4 months ago
This ideology is what caused all the problems to begin with, the base python is built as if it's the only thing in the entire operating systems environment when it's entire packaging system is also built in a way that makes that impossible to do without manually having to juggle package conflicts/incompatibilities.
whalesalad|4 months ago
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?)
1718627440|4 months ago