Live data from Hacker News

Fun with uv and PEP 723

cottongeeks.com

1–10 of 231 posts

Re: Fun with uv and PEP 723

#2
uv has been fantastic to use for little side projects. Combining uv run with `uv tool run` AKA `uvx` means one can fetch, install within a VM, and execute Python scripts from Github super easily. No git clone, no venv creation + entry + pip install.

And uv is fast — I mean REALLY fast. Fast to the point of suspecting something went wrong and silently errored, when it fact it did just what I wanted but 10x faster than pip.

It (and especially its docs) are a little rough around the edges, but it's bold enough and good enough I'm willing to use it nonetheless.

Re: Fun with uv and PEP 723

#3
If PEP 723 is only an enhancement proposal does it work only because `uv` happens to support it?

Can you not use `uvx` with your script because it only works on packages that are installed already or on PyPi?

Re: Fun with uv and PEP 723

#4
Pretty nice!

Some Python devs told me, it's an awesome language, but they envy the Node.js ecosystem for their package management.

Seems like uv finally removed that roadblock.

Re: Fun with uv and PEP 723

#5
This is really great, and it seems that it's becoming more popular. I saw it first on simonw's blog:

https://simonwillison.net/2024/Dec/19/one-shot-python-tools/

And there was a March discussion of a different blog post:

https://news.ycombinator.com/item?id=43500124

I hope this stays on the front page for a while to help publicize it.

Re: Fun with uv and PEP 723

#6

uv has been fantastic to use for little side projects. Combining uv run with `uv tool run` AKA `uvx` means one can fetch, install within a VM, and execute Python scripts from Github super easily. No git clone, no venv creation + entry + pip install. And uv is fast — I mean REALLY fast. Fast to the point of suspecting something went wrong and silently errored, when it fact it did just what I wanted but 10x faster than…

Truly. uv somehow resolves and installs dependencies more quickly than pyenv manages to print its own --help output.

Re: Fun with uv and PEP 723

#7

If PEP 723 is only an enhancement proposal does it work only because `uv` happens to support it? Can you not use `uvx` with your script because it only works on packages that are installed already or on PyPi?

PEP 723 was incorporated (with modifications) into the official Python packaging specifications: https://packaging.python.org/en/latest/specifications/inline...

I don't think running with uv vs uvx imposes any extra limitations on how you specify dependencies. You should either way be able to reference dependencies not just from PyPi but also by git repo or local file path in a [tool.uv.sources] table, the same as you would in a pyproject.toml file.

Re: Fun with uv and PEP 723

#8
post #4

Pretty nice! Some Python devs told me, it's an awesome language, but they envy the Node.js ecosystem for their package management. Seems like uv finally removed that roadblock.

I think they must have been joking!
Post reply on HN