News for hackers. Stuff that matters.
Re:Using uv as your shebang line by thecodemonkey on Tuesday January 28, 2025 @01:06PM (#42855704)
What is uv?
Re:Using uv as your shebang line by benreesman on Tuesday January 28, 2025 @01:11PM (#42855760)
It’s a package manager for Python (among other things) that is simultaneously correct and performant. It’s getting a lot of attention these days.

I highly recommend it over all conceivable alternatives.

Re:Using uv as your shebang line by IgorPartola on Tuesday January 28, 2025 @03:23PM (#42857481)
How likely is this to be another npm/yarn situation? I have used a number of Python tools that in the long run turned out to be less portable and less usable than plain Pip and virtualenv. I do use pyenv for a personal setup but not for any production use.
Re:Using uv as your shebang line by d0mine on Tuesday January 28, 2025 @04:50PM (#42858514)
You can use uv and get the benefits today: it combines the functionality from several tools (including pyenv) and the performance is such that it is transformative.
Re:Using uv as your shebang line by IgorPartola on Thursday January 30, 2025 @01:13PM (#42880433)
So it is in fact a yarn/npm situation: an alternative tool that does too many things and aims to replace a bunch of other tools.

I read the same sentiment about poetry a few years ago. Turns out tools that do one thing well are better in the long run.

Re:Using uv as your shebang line by baq on Tuesday January 28, 2025 @05:32PM (#42858981)
as if it was so simple. don't forget about pnpm.

it's the same for uv/pip/poetry except uv is so much better than the alternatives there isn't any contest. pip is the safe default (which doesn't even work out of the box on debian derivatives, which is half the issue) and uv is... just default.

Re:Using uv as your shebang line by Arrowmaster on Tuesday January 28, 2025 @08:02PM (#42860192)
As a Debian user that wanted to use a cli tool only available from npm it was horrible trying to find some sane instructions that didn't assume intimate knowledge of node package structures.

I did eventually figure out I could just do `corepack pnpm setup` then install packages globally with pnpm.

Re:Using uv as your shebang line by woodruffw on Tuesday January 28, 2025 @01:10PM (#42855750)
Re:Using uv as your shebang line by avidiax on Tuesday January 28, 2025 @01:10PM (#42855751)
Seems that it interprets a special comment block, then automatically creates a python venv and gathers dependencies. As the post[1] says, it obviates "faffing" with venv and pip to run a script.

https://akrabat.com/defining-python-dependencies-at-the-top-...