←back to thread

Fun with uv and PEP 723

(www.cottongeeks.com)
618 points deepakjois | 4 comments | | HN request time: 2.835s | source
Show context
ACAVJW4H ◴[] No.44370555[source]
finally feels like Python scripts can Just Work™ without a virtualenv scavenger hunt.

Now if only someone could do the same for shell scripts. Packaging, dependency management, and reproducibility in shell land are still stuck in the Stone Ages. Right now it’s still curl | bash and hope for the best, or a README with 12 manual steps and three missing dependencies.

Sure, there’s Nix... if you’ve already transcended time, space, and the Nix manual. Docker? Great, if downloading a Linux distro to run sed sounds reasonable.

There’s got to be a middle ground simple, declarative, and built for humans.

replies(16): >>44370574 #>>44370603 #>>44370609 #>>44370667 #>>44370757 #>>44370943 #>>44371081 #>>44371402 #>>44372258 #>>44372278 #>>44372472 #>>44372942 #>>44373775 #>>44374090 #>>44374399 #>>44376192 #
est ◴[] No.44373775[source]
> finally feels like Python scripts can Just Work™ without a virtualenv scavenger hunt.

Hmm, last time I checked, uv installs into ~/.local/share/uv/python/cpython-3.xx and can not be installed globally e.g. inside a minimal docker without any other python.

So basically it still runs in a venv.

replies(1): >>44375166 #
1. ndr ◴[] No.44375166[source]
https://docs.astral.sh/uv/reference/settings/#pip_system
replies(1): >>44375707 #
2. est ◴[] No.44375707[source]
I mean how to install `uv python install` into system-wide.

No matter what I tried it's always a symlink into ~/.local

replies(1): >>44391388 #
3. bjornasm ◴[] No.44391388[source]
>When Python is installed by uv, it will not be available globally (i.e. via the python command). Support for this feature is in preview. See Installing Python executables for details.

>You can still use uv run or create and activate a virtual environment to use python directly.

replies(1): >>44392930 #
4. est ◴[] No.44392930{3}[source]
yes that's exactly what I meant on OP's "virtualenv scavenger hunt" statement.

You still need some kind of venv, even with the power of uv.