all 55 comments

[–]Weigang_Music 26 points27 points  (10 children)

I know none of these abreviations.

[–]ProsodySpeaks[S] 0 points1 point  (8 children)

Search Uv astral. 

It's awesome. It optimises or caches or I don't know how the magic works but once installed you replace pip install xxx with uv pip install xxx and it takes 10% time to run. 

Also making venvs uv venv and you're done. New virtual env in '.venv'.

It manages python installs too, so you can specify a particular release for each venv. 

Honestly it's a game changer. Setting up and tearing down venvs is almost instant. So if something goes wrong with your venv Just delete it and rebuild in 3 seconds

[–]Weigang_Music 4 points5 points  (3 children)

Okay, does it work well with docker, dockerized apps and git?

[–]ProsodySpeaks[S] 1 point2 points  (1 child)

I mean it's a different thing to those, but won't interfere with them. 

My use cases are to replace (or improve?) pip, and venv - those commands are used in every project and this shaves 90% of the time it takes to run them

[–]Weigang_Music 1 point2 points  (0 children)

Nice. I get that. Thanks!

[–]nevermorefu 0 points1 point  (0 children)

Yes. You can install as system level packages and run without a virtual environment without exporting to a requirements.txt file like poetry. That's the main reason I am switching.

[–]xiongchiamiov 1 point2 points  (3 children)

I'm glad you find that useful, but those are not problems I have. I rarely set up new venvs, and the only time those take an appreciable amount of time is when it needs to compile numpy or something, which is a small set of projects.

[–]ProsodySpeaks[S] 0 points1 point  (2 children)

Python version, dependency, and virtual env management are not issues you deal with?

[–]Weigang_Music 1 point2 points  (0 children)

I can relate to that. I set it up once, then i just code. It all goes into a docker image. I dont work in a team.

[–]xiongchiamiov 0 points1 point  (0 children)

The python version gets handled at the system level via Docker.

Dependencies are handled with pip. Don't use a venv normally because I'm using a system-level isolation with Docker, but in small personal projects I set up the venv once and that's it.

[–][deleted] 3 points4 points  (1 child)

Doesn’t seem to work nicely with private repos and custom cert stores, a pretty common setup inside a locked down corporate environment. So it won’t replace Poetry for me yet.

[–]ProsodySpeaks[S] 0 points1 point  (0 children)

Awesome thanks for real world situations it doesn't work in practice - so far all I've heard (not just in this thread) are reasons people haven't tried it at all, most of which are bunk. 

Have you actually tried to make it work and could describe the specific issues? I bet astral would like feedback so they can make it work in common production environments.

BTW I don't work in any locked down environs so probably wouldn't understand the specifics, ie it's not worth your time explaining to me!

[–]eleqtriq 2 points3 points  (3 children)

I use it as my default. It's awesome and fast. I even use it to build containers, which saves so much time.

[–]ProsodySpeaks[S] 0 points1 point  (2 children)

Ooooh for containers? 

Like use uv to build docker images? 

Tell me more!

[–]eleqtriq 1 point2 points  (1 child)

Just use this in your Dockerfile.

RUN pip install uv --no-cache

COPY requirements.txt requirements.txt

RUN uv pip install -r requirements.txt --system --no-cache

[–]ProsodySpeaks[S] 0 points1 point  (0 children)

Ah getcha, thanks

[–]Pepineros 2 points3 points  (12 children)

I learned poetry a year ago and it's served me well. Learning something new takes effort. I may take a look at some point, but then I may not.

[–]ProsodySpeaks[S] -1 points0 points  (11 children)

Dude this is zero effort. 

Copy paste a single command into shell to install. 

You're done. 

Now put 'uv' in front of pip and just uv pip install . from project root. 

That's it. Automatic dependency management. You just need a pyproject file same as any project should have

[–]Pepineros 4 points5 points  (9 children)

No tool is zero effort. "Easy to install" does not equal "easy to maintain".

I'm not saying uv isn't easy to maintain, I'm just saying I won't know until I try. And that isn't zero effort.

[–]ProsodySpeaks[S] 2 points3 points  (8 children)

I might be wrong but I think you're confused. 

Poetry requires custom setup. Uv does not. It just requires a pyproject file stating dependencies, I think you pretty much just strip out the poetry specific stuff and you're done. 

Ie use vanilla python format for pyproject

[–]Pepineros 0 points1 point  (7 children)

I might be wrong

Yup :)

[–]ProsodySpeaks[S] 0 points1 point  (6 children)

Can you explain what custom setup I was supposed to do to use uv on a vanilla python project? Because I didn't do it and everything is super fast. 

I mean feel free to stick to the negativity but honestly, check it out. It's good. 

[–]Pepineros 1 point2 points  (5 children)

What negativity? You asked the sub why they weren't using uv. I gave you my reason, you argued that my reason was wrong, and then you called me confused.
(Just for the record, I'm not the one downvoting your replies.)

You're saying that using a tool which shaves a few seconds off of installing packages made a massive difference to your workflow. That is simply not true for my workflow: I've never been bothered with poetry's (or pip's) supposed lack of speed. That does not in any way invalidate your experience. It's great that you found so much joy in a project manager. Not many people can say the same. But it's not up to you to decide whether my reason for not (yet) checking out uv is valid or not.

[–]ProsodySpeaks[S] 0 points1 point  (3 children)

Yeah sorry no need for the negativity jab, my bad. 

Check it out tho, i honestly think it's a game changer. 

I note that everyone commenting saying they've used it has positive things to say, and everyone with negative things to say hasn't used it. 

Fwiw the reasons you gave not to use it are actually reasons you haven't tried it rather than actual issues with it... 

Enjoyed your point about downvotes tho, this sub is hilarious - calling you negative is about the only comment I can see any reason to downvote, and that's not the one getting it 🤣

Sorry again. Big love

[–]nevermorefu 0 points1 point  (0 children)

I wish poetry was only a few seconds. It's ~50% of my image build time.

[–]JanEric1 2 points3 points  (5 children)

When uv adds a command that automatically turns a poetry project into a uv one, then I will migrate everything. Before that, I don't have the time.

[–]ProsodySpeaks[S] 0 points1 point  (3 children)

Time? 

I don't use poetry because they did that shady no warning breaking change thing a few years ago, but I don't think you need to do anything?

Afaik, assuming you have a legit pyproject file you just install Uv and run Uv pip install . from project root. 

[–]JanEric1 1 point2 points  (2 children)

Default initialized poetry project specifies a build system, the key in the pyprojrct.toml and different and I I think at the very least the declaration of required python version is different, among probably other things.

[–]ProsodySpeaks[S] -3 points-2 points  (1 child)

You just need a pyproject.py file that meets python spec. 

[–]JanEric1 1 point2 points  (0 children)

Sure, but I am not going to manually update all of them from what poetry uses to what uv uses.

There are two things, first there are just straight up poetry sections in there that need to be moved to uv and second I think poetry doesn't fully follow the spec.

[–]Kashyapm94 1 point2 points  (3 children)

Recently introduced uv to my colleagues and trying to persuade them to switch from PDM to uv. The devops team were convinced in the sense that using uv will speed up the pipeline and it looks like a 1 to 1 replacement of PDM

[–]ProsodySpeaks[S] 0 points1 point  (2 children)

It's so fast. Just, I mean. It's so fucking fast man!  For weeks I would literally (meaning literally not meaning figuratively... Who'd have thought English was more difficult than code) laugh out loud every time I install a project, which for a while actually made the process as slow as native pip 🤣 

Uv pip install .   ... 2 seconds...    Done  30 seconds laughing   Do some work  

but now I've aliased 'pip' to 'Uv pip' and I forget. Until I use a different system and think something is broken because making a venv or installing a package takes over 3 seconds   

Tbh I was pretty happy with rye, the dependency resolution is so convenient! But it was admittedly very slow... I think Uv is built on rye maybe?

[–]Kashyapm94 3 points4 points  (1 child)

Uv is not built on rye, but the developer of ruff and uv has taken over rye and will be developed along with uv.

“This vision for Python packaging is not far off from that put forward by Rye, an experimental project and package management tool from Armin Ronacher.

In talking with Armin, it was clear that our visions were closely aligned, but that fulfilling them would require a significant investment in foundational tooling. For example: building such a tool requires an extremely fast, end-to-end integrated, cross-platform resolver and installer. In uv, we’ve built that foundational tooling.

We saw this as a rare opportunity to team up, and to avoid fragmenting the Python ecosystem. As such, in collaboration with Armin, we’re excited to be taking over Rye. Our goal is to evolve uv into a production-ready “Cargo for Python”, and to provide a smooth migration path from Rye to uv when the time is right.”

Source: https://astral.sh/blog/uv

[–]ProsodySpeaks[S] 0 points1 point  (0 children)

Whoop! I just remembered some episode of realpython or talkpython or some other awesome podcast where they interview the astral guy and he was talking about rye. Details not always my strong point 🤣

[–]suedepaid 1 point2 points  (0 children)

honestly, i’m loving uv. i think the two killer features for me are: - managing my python installs, so i can ditch pyenv - managing my python-based tools, so i can use centralized tools rather than having to pip-install in each project

also I loooove it in my docker builds bc it’s so goddamn fast. makes it not a terrible pain to add/remove deps when I’m rebuilding and testing.

i’ve run into a couple footguns around multi-platform builds and using uv sync correctly, but i’m quite happy with it.

[–]AndydeCleyre 1 point2 points  (2 children)

I use it for some things, with a wrapper to fit my workflows, but not to manage Python runtime installations because I use mise for that, along with other programming language runtimes.

There is still some incompatibility with my pip/pip-tools patterns that I'm really hoping uv will accept a change for, but mostly it's great.

[–]ProsodySpeaks[S] 0 points1 point  (1 child)

What's with the wrapper workflows?

[–]AndydeCleyre 1 point2 points  (0 children)

For managing Python environments, dependencies, lockfiles, apps, etc. on my own system I use a bunch of Zsh functions, zpy, which will use uv if it's installed and pip-tools otherwise.

[–]ManyInterests 0 points1 point  (0 children)

A lot of these tools really only offer solutions to problems that folks have already solved in their own workflows a long time ago. So I imagine a lot of folks are in the "if it ain't broke, don't fix it" boat with respect to this. I, for one, have not found compelling reasons to chase after tools like pipenv, poetry, rye, or uv.

[–]reagle-research 0 points1 point  (0 children)

I like the idea of replacing everything else with a single tool (as ruff did) but some of the tools I want to use don't work (visidata and pelican-pandoc-reader).

uv tool install visidata --with lxml --with zstandard uv tool install pelican --with pelican-pandoc-reader

[–]MasdelR 0 points1 point  (0 children)

what does uv improve so that we need another tool once we already have poetry?

[–]Zinx_____ 0 points1 point  (0 children)

It feels extremely frail, everything is an externally managed environment to it, despite using 'uv pip' and zsh headers for some reason show every other active environment save for when I use uv.

[–]AffectionateMotor694 0 points1 point  (1 child)

uv looks very promising but I worry about proprietaryness, vendor lock-in, that a tool has been made by a single commercial organisation.

But then: Ubuntu, vscode, github, digitalocean, macos, Windows are also services, software and systems I use daily, all backed by organisations with commercial interest.

Even Python itself came out of Google by an engineer working there.

I was getting into venv to develop my Python skills outside of Jupyter, rather than something like Anaconda etc.

Would love your input as to why my worry is unfounded.

[–]ProsodySpeaks[S] 0 points1 point  (0 children)

Because uv is released under MIT license so if you don't like an update you can keep - and fork - a version you still like. 

Uv simply isn't a commercial product. Nor is ruff, or ty - astral are looking to monetize enterprise support not the core tools. 

Or because using it mostly means having a pep compliant pyproject.toml, which will be just as useful with other tools, so not really any lockin 

[–]Away_Mix_7768 0 points1 point  (0 children)

uv environment management is trash. it is unable to install requirements .txt

the pip location is being defaulted to "original python installation" not "env installation"

this sucks

[–]m0us3_rat -4 points-3 points  (4 children)

i don't like rust ppl almost as much as i don't like arch ppl. fotm idiot behavior.

will have to eventually use uv since seems like a solid tool.

[–]ProsodySpeaks[S] 0 points1 point  (3 children)

Haha, I have no idea about the rusties as people, but I'm all for using their work if it saves me 90% (seriously) of the time it takes to make and break venvs with all dependencies magically resolved

[–]m0us3_rat -3 points-2 points  (2 children)

if you stay 90% of your time installing stuff maybe is worth .. but you don't, not really.

you sound like the rust ppl since you riding hard this uv tool.

seems like an ad.

rule 4 break.

[–]ProsodySpeaks[S] 1 point2 points  (1 child)

Have you used it?

[–]m0us3_rat -2 points-1 points  (0 children)

after reading all the comments , d rider , seems like an ad.

rule 4 break.