Live data from Hacker News

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

emily.space

161–170 of 1001 posts

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

#161
post #21

I must be the odd man out but I am not a fan of uv. 1. It tries to do too many things. Please just do one thing and do it well. It's simultaneously trying to replace pip, pyenv, virtualenv, and ruff in one command. 2. You end up needing to use `uv pip` so it's not even a full replacement for pip. 3. It does not play well with Docker. 4. It adds more complexity. You end up needing to understand all of these new enviro…

> It tries to do too many things. Please just do one thing and do it well. It's simultaneously trying to replace pip, pyenv, virtualenv, and ruff in one command. uv doesn’t try to replace ruff. > You end up needing to use `uv pip` so it's not even a full replacement for pip. "uv pip" doesn't use pip, it provides a low-level pip-compatible interface for uv, so it is, in fact, still uv replacing pip, with the speed and…

There is an optional & experimental code formatting tool within uv (that just downloads riff), which is what OP may be referring to: https://pydevtools.com/blog/uv-format-code-formatting-comes-...

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

#162

I'd put type annotations and GIL removal above UV without a second thought. UV is still young and I hit some of those growing pains. While it is very nice, I'm not going to put it up there with sliced bread, it's just another package manager among many

For that matter, IMX much of what people praise uv for is simply stuff that pip (and venv) can now do that it couldn't back when they gave up on pip. Which in turn has become possible because of several ecosystem standards (defined across many PEPs) and increasing awareness and adoption of those standards. The "install things that have complex non-Python dependencies using pip" story is much better than several years…

For sure, we see the same thing in the JS ecosystem. New tooling adds some feature, other options implement feature, convergence to a larger common set.

I'm still mostly on poetry

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

#163
post #21

I must be the odd man out but I am not a fan of uv. 1. It tries to do too many things. Please just do one thing and do it well. It's simultaneously trying to replace pip, pyenv, virtualenv, and ruff in one command. 2. You end up needing to use `uv pip` so it's not even a full replacement for pip. 3. It does not play well with Docker. 4. It adds more complexity. You end up needing to understand all of these new enviro…

This. I was researching uv to replace my pipenv+pyenv setup, but after reading up a bit I decided to just give up. Pipenv is just straightforward and “just works”. Aside from being slow, not much is wrong with it. I’m not in the mood to start configuring uv, a tool that should take me 2 minutes and a “uv —-help” to learn.

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

#165
post #21

I must be the odd man out but I am not a fan of uv. 1. It tries to do too many things. Please just do one thing and do it well. It's simultaneously trying to replace pip, pyenv, virtualenv, and ruff in one command. 2. You end up needing to use `uv pip` so it's not even a full replacement for pip. 3. It does not play well with Docker. 4. It adds more complexity. You end up needing to understand all of these new enviro…

If your pyproject.toml is setup properly you shouldn't need to use `uv pip` at all.

I'm using uv in two dozen containers with no issues at all. So not sure what you mean that it doesn't play well with Docker.

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

#166

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.

Why is the ‘-S’ argument to ‘env’ needed? Based on the man page it doesn’t appear to be doing anything useful here, and in practice it doesn’t either.

> Based on the man page it doesn’t appear to be doing anything useful here

The man page tells me:

  -S, --split-string=S
         process and split S into separate arguments; used to pass multi‐
         ple arguments on shebang lines
Without that, the system may try to treat the entirety of "uv run --script" as the program name, and fail to find it. Depending on your env implementation and/or your shell, this may not be needed.

See also: https://unix.stackexchange.com/questions/361794

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

#167
post #160

I love uv. But the post starts with a simple install using a oneliner curl piping to sh, which is such a big attack surface area… I would much rather have a much longer one liner that increases safety.

Isn't uv like... a Rust binary? If that sh has any sense it just copies the binary and adds it to PATH.

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

#168
post #160

I love uv. But the post starts with a simple install using a oneliner curl piping to sh, which is such a big attack surface area… I would much rather have a much longer one liner that increases safety.

It seems to be a trend in the rust community. I guess because rustup is suggested to be installed that way.

But you don't have to. Brew and other package managers hold uv in their registries.

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

#169

A problem remain in that many and still more of the popular repositories don't use uv to manage their dependencies. So you are back having to use conda and the rest. Now, you have yet another package manager to handle. I wouldn't be harsh to engineers at astral who developed amazing tooling, but the issue with the python ecosystem isn't lack of tooling, it is the proliferation and fragmentation. To solve dependency m…

Don't they publish to PyPi? What do you care what they use behind the scenes?

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

#170

Earlier quoted context omitted.

Why is the ‘-S’ argument to ‘env’ needed? Based on the man page it doesn’t appear to be doing anything useful here, and in practice it doesn’t either.

> Based on the man page it doesn’t appear to be doing anything useful here The man page tells me: -S, --split-string=S process and split S into separate arguments; used to pass multi‐ ple arguments on shebang lines Without that, the system may try to treat the entirety of "uv run --script" as the program name, and fail to find it. Depending on your env implementation and/or your shell, this may not be needed. See als…

Right, I didn’t think about the shebang case being different. Thanks!
Post reply on HN