←back to thread

Fun with uv and PEP 723

(www.cottongeeks.com)
618 points deepakjois | 1 comments | | HN request time: 0s | source
Show context
4dregress ◴[] No.44374002[source]
I’ve been a python dev for nearly a decade and never once thought dep management was a problem.

If I’ve ever had to run a “script” in any type of deployed ENV it’s always been done in that ENVs python shell .

So I still don’t see what the fuss is about?

I work on a massive python code base and the only benefit I’ve seen from moving to UV is it has sped up dep installation which has had positive impact on local and CI setup times.

replies(7): >>44374205 #>>44374268 #>>44374280 #>>44374598 #>>44375288 #>>44378102 #>>44391546 #
petersellers ◴[] No.44374205[source]
> it’s always been done in that ENVs python shell .

What if you don't have an environment set up? I'm admittedly not a python expert by any means but that's always been a pain point for me. uvx makes that so much easier.

replies(2): >>44374524 #>>44378236 #
arcanemachiner ◴[] No.44378236[source]
Create a virtual environment:

python3 -m venv venv

Activate the virtual environment:

source venv/bin/activate

Deactivate the virtual environment:

deactivate

replies(1): >>44379071 #
petersellers ◴[] No.44379071{3}[source]
Or: `uvx ruff`

Which one is easier to run, especially for someone who doesn't use python everyday?

replies(1): >>44379559 #
arcanemachiner ◴[] No.44379559{4}[source]
The one they definitely won't have to re-learn in a few years.
replies(2): >>44380496 #>>44391723 #
1. petersellers ◴[] No.44380496{5}[source]
It's still easier if you use virtual environments so infrequently that you have to look up how to do it every time.