←back to thread

741 points chirau | 2 comments | | HN request time: 0.203s | source
Show context
6ak74rfy ◴[] No.44358674[source]
UV is fast, like FAST. Plus, it removes the need for pyenv (for managing different Python versions) and pip for me. Plus, no need to activate env or anything, `uv run ...` automatically runs your code through the env.

It's a nice software.

replies(1): >>44358815 #
nomel ◴[] No.44358815[source]
> Plus, it removes the need for pyenv

I don't see a way to change current and global versions of python/venvs to run scripts, so that when I type "python" it uses that, without making an alias.

replies(3): >>44359039 #>>44360892 #>>44361369 #
adamckay ◴[] No.44359039[source]
If they're your scripts (i.e. your writing/editing them) then you can declare dependencies following the PEP723 format and uv will respect that.

https://docs.astral.sh/uv/guides/scripts/#declaring-script-d...

replies(1): >>44360402 #
1. nomel ◴[] No.44360402[source]
> uv run example.py

I specifically want to run "python", rather subcommands for some other command, since I often I want to pass in arguments to the python interpreter itself, along with my script.

replies(1): >>44368697 #
2. maleldil ◴[] No.44368697[source]
You can use "uv run python script.py" to the same effect.