Live data from Hacker News

Uv is the best thing to happen to the Python ecosystem in a decade

emily.space

611–620 of 1001 posts

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#611
post #394
post #172

Earlier quoted context omitted.

Without -S, `uv run --script` would be treated as a binary name (including spaces) and you will get an error like "env: ‘uv run --script’: No such file or directory". -S causes the string to be split on spaces and so the arguments are passed correctly.

On these systems, wouldn’t binfmt attempt to exec(“/usr/bin/env -S uv run --script”, “foo.py”) and fail anyway for the same reason?

Most systems split at least the 1st space since decades.

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#612

Can someone steelman the python tooling ecosystem for me? Having a new packaging / dependency manager every few years seems excessive.

uv is finally an all-in-one tool that finally takes all of the good ideas from previous projects and combines them together to work well as one (and unbelievably fast). The fact that it's a binary, not written in python, also simplifies bootstrapping. So you don't need python+dependencies installed in order to install your python+dependencies.

One helpful element that has changed over the years compared to the old wild west days is the large number of PEPs that have quietly in the background bit by bit standardized packaging formats and requirements.

Some foundations have moved into the stdlib. This means that newer tools are much more compatible with each other and mainly just differ in implementation rather than doing different things altogether. The new stuff is working on a much more standard base and can leave behind many dark crufty corners.

Unravelling the legacy stuff and putting the standards in place seems to have taken 15+ years?

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#613

Honestly though it's a pretty rough indictment of Python that the best thing to happen in a decade is that people started writing Python tools in Rust. Not even a little Rust, uv is 98% Rust. I mean, they just released 3.14 and that was supposed to be a pretty big deal.

No, the "best thing that happened" (in TFA's author's opinion) is that this specific tool exists, with its particular design. Rust is an implementation detail. Most of the benefit that Uv offers over pip, in my analysis, is not a result of being written in Rust. 3.14 is a big deal.

I don't think Rust is incidental here. First, uv's particular design cargo culted from... well cargo. Which, they should be cause cargo is a great tool, no shade there.

But otherwise, people on this forum and elsewhere are praising uv for: speed, single-file executable, stability, and platform compatibility. That's just a summary of the top reasons to write in Rust!

I agree 3.14 is a big deal as far as Python goes, but it doesn't really move the needle for the language toward being able to author apps like uv.

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#614
I completely agree. Deploying Python packages like MCP servers has been a real game changer. I'm so glad the days of wrestling with conda environments and Jupyter kernels are behind us. I used to start personal projects, decide to clean up my Python setup first, and inevitably give up on the project after getting lost in the cleanup.

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#615

I’m surprised not to see a discussion of the biggest drawback: despite being fewer characters, “uv” is harder to type than “pip”. It requires two different hands to participate and a longer reach with my left index finger. pip is convenient – just a little rattle off with my right hand.

Linters and formatters are things you shouldn't have to run by hand.. that's what you have CIs, git hooks, IDEs, etc for

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#616
It's surprising to me how long it can take for some languages to get decent package management solutions. There are no silver bullets because it's tricky to "encode" compatibility in a version number. I personally think semver helped a little and damaged a lot more by selling a pseudo solution that stands no chance to solve the real problem it needs to.

Maven has always been a very good solution. I think Bazel is too, but haven't had much experience with it.

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#617

curl|sh and iwr|iex chills my spine, no one should recommend these methods of installation in 2025. I'm against closed computers but I'm also against reckless install. Even without the security concerns these way of installation tends to put files in a whole random places making it hard to manage and cleanup.

How is it even different from running a pre compiled binary

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#618
post #123

Or is it a corporate grab to gain more influence in the ecosystem? I like the idea, but for profit backing is out of the question. This lesson has been learned countless times.

no, it's a python library, get a grip. Also "This lesson has been learned countless times"? No it hasn't, since when has a package manager developed by a for-profit company hurt the ecosystem?

Was that a dig at the recent RubyGems situation?

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#619

Earlier quoted context omitted.

Never 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

Hey and you can use both lanes in a zip merge!

Isn't that the law anyway?

Morale: follow the rules.

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#620
post #222

For single-file Python scripts, which 99% of mine seem to be, you can simplify your life immensely by just putting this at the top of the script: #!/usr/bin/env -S uv run --script # /// script # requires-python = ">=3.11" # dependencies = [ "modules", "here" ] # /// The script now works like a standalone executable, and uv will magically install and use the specified modules.

I use this but I hate it. I want to be able to ship a bundle which needs zero network access to run, but will run. It is still frustratingly difficult to make portable Python programs.

Have you tried Nuitka? It takes a little effort but it can compile your Python program to a single executable that runs without network access.
Post reply on HN