5 ms·
That's my experience. I'm not a Python developer, and installing Python programs has been a mess for decades, so I'd rather stay away from the language than try
by idoubtit 9mo ago
That's my experience. I'm not a Python developer, and installing Python programs has been a mess for decades, so I'd rather stay away from the language than try another new tool.
Over the years, I've used setup.py, pip, pipenv (which kept crashing though it was an official recommendation), manual venv+pip (or virtualenv? I vaguely remember there were 2 similar tools and none was part of a minimal Python install). Does uv work in all of these cases? The uv doc pointed out by the GP is vague about legacy projects, though I've just skimmed through the long page.
IIRC, Python tools didn't share their data across projects, so they could build the same heavy dependencies multiple times. I've also seen projects with incomplete dependencies (installed through Conda, IIRC) which were a major pain to get working. For many years, the only simple and sane way to run some Python code was in a Docker image, which has its own drawbacks.
- lexicality 9mo ago> Does uv work in all of these cases? Yes. The goal of uv is to defuck the python ecosystem and they're doing a very good job at it so far.
- aeurielesn 9mo agoThat's giving way too much credit to uv.
- karel-3d 9mo agouv is really that good.
- hexo 9mo agoIf so, ok, let's port this prototype to back to python and get rid of uv.
- llbeansandrice 9mo agoWhat does this comment mean? Port the dependency and virtual environment manager back to the language? Should we port npm “back” to node js?
- karel-3d 9mo agoWell, go does have the module management, including downloading new versions of itself, built-in into the `go` tool itself. It is really great. But I don't see this hapenning in python.
- hexo 9mo agoYou don't see that happening because you don't want to.
- hexo 9mo agonpm is written in javascript, not rust or c#. yes, we should bring package manager back. if it is so awesome and solves some problem.
- lexicality 9mo agoSounds good, I agree that uv should come with the language in the same way npm comes with node and cargo comes with rust. You keep using words like "we" and "us" so I assume you'll be kicking off writing the PEP to make this happen?
- NeutralCrane 9mo agoIt really isnt
- kraddypatties 9mo agoI'm interpreting this as "uv was built off of years of PEPs", which is true; that being said the UX of `uv` is their own, and to me has significantly reduced the amount of time I spend thinking about requirements, modules, etc.
- lexicality 9mo agoThey've definitely not done it yet, but they're getting there.
- prox 9mo agoWhat are the big offenders right now? What does uv unfuck? I only work a little bit with python.
- lucideer 9mo agouv not only completely replaces all of pip, pyenv & venv, but it also does a much better job than any of them at their intended function, as well as a bunch of other convenient, simple developer-friendly features. 1. pip isn't entirely to blame for all of Python's bad package management - distutils & setuptools gave us setup.py shenanigans - but either way, UV does away with that in favour of a modern, consistent, declarative, parseable PEP 508 manifest spec, along with their own well-designed lockfile (there was no accepted lockfile PEP at the time UV was created - since PEP 715 has become accepted UV has added support, though that PEP is still limited so there's more work to do here). 2. pyenv works fine but uv is faster & adds some nice extra features with uvx 3. venv has always been a pain - ensuring you're always in the right venv, shell support, etc. uv handles this invisibly & automatically - because it's one tool you don't need to worry about running pip in the right venv or whatever.
- kevin_thibedeau 9mo agopip and venv. The Python ecosystem has taken a huge step backwards with the preachy attitude that you have to do everything in a venv. Not when I want to have installable utility scripts usable from all my shells at any time or location. I get that installing to the site-packages is a security vulnerability. Installing to my home directory is not, so why can't that be the happy path by default? Debian used to make this easy with the dist-packages split leaving site-packages as a safe sandbox but they caved.
- kstrauser 9mo agoRegarding why not your home directory: which version of Foo do you install, the one that Project A needs or the incompatible one that Project B needs? The brilliant part about venvs is that A and B can have their completely separate mutually incompatible environments.
- simonw 9mo ago> IIRC, Python tools didn't share their data across projects, so they could build the same heavy dependencies multiple times. One of the neatest features of uv is that it uses clever symlinking tricks so if you have a dozen different Python environments all with the same dependency there's only one copy of that dependency on disk.
- zahlman 9mo agoHard links, in fact. It's not hard to do, just (the Rust equivalent of) `os.link` in place of `os.copy` pretty much. The actually clever part is that the package cache actually contains files that can be used this way, instead of just having wheels and unpacking them from scratch each time. For pip to do this, first it would have to organize its cache in a sensible manner, such that it could work as an actual download cache. Currently it is an HTTP cache (except for locally-built wheels), where it uses a vendored third-party library to simulate the connection to files.pythonhosted.org (in the common PyPI case). But it still needs to connect to pypi.org to figure out the URI that the third-party library will simulate accessing.
- runjake 9mo agoI would not be putting up with Python if not for uv. It’s that good. Before uv came along I was starting to write stuff in Go that I’d normally write in Python.
- QuercusMax 9mo agoComing from a mostly Java guy (since around 2001), I've been away from Python for a while and my two most recent work projects have been in Python and both switched to uv around the time I joined. Such a huge difference in time and pain - I'm with you here. Python's always been a pretty nice language to work in, and uv makes it one of the most pleasant to deal with.
- runjake 9mo agoI don't even like Python as a language (it's growing on me, but only a little). It's just so useful: uv is great and there are decent quality packages for everything imaginable.
- whimsicalism 9mo agouv solved it, it’s safe to come back now.
- kristianbrigman 9mo agoThat's partly because python has a very large installed base, and ease of entry (including distribution). This leads to people running into issues quicker, and many alternative solutions. Unlike something like Rust, which has much fewer users (though growing) and requires PhDs in Compiler Imprecation and Lexical Exegetics. Or C++ which has a much larger installed base but also no standard distribution method at all, and an honorary degree in Dorsal Artillery.