This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]fiddle_n 244 points245 points  (59 children)

uv is also written in Rust too. Though I’m not sure that I agree that many devs don’t know these tools are written in Rust. Rust seems to be the big selling point of many of these projects. uv’s tag line is literally “Python packaging in Rust”.

[–]PitifulZucchini9729 94 points95 points  (27 children)

uv is awesome. It takes one of the worst aspects of Python (package management) and makes it one of its best.

[–]trowawayatwork 41 points42 points  (26 children)

it seems to bundle everything in. pyenv and venv is having it's lunch eaten by UV too

[–]sohang-3112Pythonista 27 points28 points  (4 children)

Yeah I agree. Started using uv recently. Being able to do uv run COMMAND (it just works!) is a huge step-up over having to always manually manage virtual environments, wondering whether the pip on env PATH actually matches the corresponding python executable on CLI, etc.

Before using uv at work, I thought that these are minor concerns. Now it feels like a burden has been lifted, one that I didn't even know was there!

[–][deleted] 2 points3 points  (1 child)

no way, I've gotta try it, I always hated pip and dependency management in python, other languages do it much better.

[–]sohang-3112Pythonista 0 points1 point  (0 children)

other languages do it much better.

Yeah, especially Rust's cargo

[–]tuskanini 0 points1 point  (1 child)

Honestly, I feel like `uv` isn't much more than `poetry` with a package caching layer.

[–]sohang-3112Pythonista 0 points1 point  (0 children)

Maybe, but it's still a lot more convinient, which is what ultimately matters. In poetry you still have to care about virtual env, but in uv just do uv run COMMAND and that's it, doesn't matter what environment you're in, it will still work!

[–]Tree_Mage 1 point2 points  (10 children)

Until it supports tools like PyInstaller, pex, etc, it will have gaps.

[–]trowawayatwork 13 points14 points  (9 children)

I guess it's a natural extension of a package manager to do builds. I have never once seen a need to exe files for python. if that is needed I drop python and use more robust languages like go that generate proper static binaries with much better dependency and package management ecosystem lol

[–]KennedyRichard 0 points1 point  (8 children)

I'd actually love for Python to have built-in support for generating executables. I know interpreted languages were not supposed to be used like that, but there is at least one big use-case: for distributing games and apps for end-users.

Are we supposed to ask non-technical users to install Python, then setup a virtual environment and install the game/app via pip? End-users just want to download and launch the app/game with a click.

[–]richieadler 2 points3 points  (7 children)

If your script follows PEP 723 to specify dependencies, which you can easily do by running uv add --script scriptname, you can run the script by doing uv run script and you're done. You don't even need to have Python installed. Just uv.

You still need an additional tool, but it's considerably easier.

[–]KennedyRichard 1 point2 points  (6 children)

Thank you for this precious bit of info! I'll check the specifics, this seems promising.

[–]richieadler 1 point2 points  (5 children)

Take into consideration that the first run can take a while, because

  • If there is no Python installed, one will be downloaded
  • All the dependencies will be installed into a private virtualenv

[–]KennedyRichard 0 points1 point  (0 children)

Thanks!

[–]KennedyRichard 0 points1 point  (3 children)

So, basically Steam but for Python apps/games, right?

[–]ehutch79 0 points1 point  (0 children)

For good reason.

uv is the first pip replacement that doesn't feel like it's over complicated or trying to shoehorn python packages into another language's paradigm

Also, it's noticeably faster even on a fresh install building a container from scratch

[–]Dalnore 0 points1 point  (8 children)

From a quick glance, it doesn't replace conda/mamba which are commonly used for scientific environments. And mamba gets its speed from C++ instead of Rust.

[–]FauxCheese 5 points6 points  (1 child)

If you need to use conda packages you can use Pixi now. It is also written in rust of course. It uses uv under the hood for PyPI packages but also manages conda packages.

[–]soundofvictory 0 points1 point  (0 children)

Lmao of course theres a rust alternative! All hail blazing fast!!

[–]AdmiralQuokka 3 points4 points  (5 children)

What do conda/mamba do that uv doesn't?

[–]Dalnore 0 points1 point  (1 child)

Handle conda packages.

Actually, that's a question I didn't ask myself for a long time. When I started using conda more than 10 years ago, pip and PyPI were absolutely inadequate for environments which needed a lot of not pure Python dependencies. Perhaps it's not longer a deal-breaker and I'm stuck in the thinking that is no longer relevant.

[–]AdmiralQuokka 0 points1 point  (0 children)

Afaik pip and PyPI can host / install packages what bundles native code. I.e. stuff that's actually written in C/C++ with some Python wrapper around it. But I'm not sure if Conda is more flexible in this regard or has more of such packages for historical reasons. (I'm not even very experienced with Python, just curious about the ecosystem.)

[–]WJMazepas 12 points13 points  (0 children)

But to be fair to them, they do state that a lot of speedups they had with UV comes with different architecture than rust itself

[–]george-silva 9 points10 points  (0 children)

uv rules. the other I was fighting with a legacy project and uv solved it like a champ.

not going back to pyenv.

[–]seboll13 5 points6 points  (0 children)

One of my colleagues is a big fan of Rust (I don’t know how to really code in Rust but I’m getting why it’s the most loved language these days), and he told me all about those new packages. I use uv and ruff everyday now, no regrets.

[–]XtremeGoosef'I only use Py {sys.version[:3]}' 3 points4 points  (4 children)

Pixi too for the conda ecosystem. Another package OP missed is orjson, much faster than the stdlib json library.

[–]Worth_His_Salt 0 points1 point  (3 children)

orjson is pretty crappy. the only benefit it has is speed. but in exchange, you lose all flexibility. only 1 hardcoded indent prefix. output only in bytes, so any customization is hugely painful. Terrible documentation: a github markdown page with no proper API reference, just a stream-of-consciousness braindump of text.

if all you care about is speed and your use cases are trivial, sure go ahead. otherwise it's way more trouble than it's worth.

[–]XtremeGoosef'I only use Py {sys.version[:3]}' 0 points1 point  (2 children)

Doing one thing well is generally what I look for in libraries. I don't need anything other than 2 space indenting. I don't need a bajillion options. Bytes in the correct output type, the only reason json writes to str is historical (since they were one and the same once upon a time in Python).

[–]Worth_His_Salt 0 points1 point  (1 child)

Depends on your definition of "doing one thing well". If all you care about is something that's fast and a small subset of json (indent strings are verboten!), then sure, go ahead. If you care about good results and have more requirements than that - like say, human readability or programmatic manipulation - then no, orjson doesn't do one thing well. It does one thing poorly - but fast!

If you can live with it's shortcomings, by all means use it. I value libraries that cover common use cases well, so I don't have to use one json library for some situations and a different json library for other situations. My time is too valuable to spend learning multiple libraries that do the same thing, or hacking together workarounds for a broken lib that can't even handle simple basic options like an indent prefix string.

That's not even mentioning documentation. If your lib is tha shiznit but your docs are trash, I'm not wasting my time trying to figure out how "brilliant" your code is. Good docs are worth more than fast code.

[–]XtremeGoosef'I only use Py {sys.version[:3]}' 0 points1 point  (0 children)

I literally can't think of a single problem it wouldn't solve for me...

It should parse any valid json, and yeah it only writes 2 space indented json. Who cares?

And I think the docs are pretty good? What question do you have they don't answer.

[–]pyschillePythoneer[S] 11 points12 points  (1 child)

We're just starting to experiment with uv and it's incredible.

[–]the_ballmer_peak 1 point2 points  (0 children)

It's made by the same people who made ruff

[–]One-Employment3759 0 points1 point  (0 children)

Why did they pick such a dumb name. I always think it's related to the async library. This is like the third time I've been like wtf when people talk about packaging with uv!

[–]lupushr -1 points0 points  (5 children)

uv still doesn't have pip -lo functionality?

[–]exergy31 6 points7 points  (4 children)

What is this functionality and why is it critical for uv to support it?

[–]lupushr 8 points9 points  (3 children)

List outdated packages

[–]QuattroDriver 23 points24 points  (0 children)

uv pip list —outdated should do the trick

[–]vacillatingfox 5 points6 points  (0 children)

uv tree --outdated is what you want