News for hackers. Stuff that matters.
Re:Using uv as your shebang line by mingus88 on Tuesday January 28, 2025 @04:03PM (#42857954)
Yeah, my first reaction was cool, what’s uv

Oh, yet another python dependency tool. I have used a handful of them, and they keep coming

I guess no work is important enough until it gets a super fast CLI written in the language du jour and installed by piping curl into sh

Re:Using uv as your shebang line by kernelbugs on Tuesday January 28, 2025 @04:56PM (#42858575)
I believe parent comment was about `env -S` not being portable rather than `uv` being portable.

I'll say, I am as pessimistic as the next person about new ways to do X just to be hip. But as someone who works on many different Python projects day to day (from fully fledged services, to a set of lambdas with shared internal libraries, to CI scripts, to local tooling needing to run on developer laptops) - I've found uv to be particularly free of many sharp edges of other solutions (poetry, pipenv, pyenv, etc).

I think the fact that the uv tool itself is not written in Python actually solves a number of real problems around bootstrapping and dependency management for the tool that is meant to be a dependency manager.

Re:Using uv as your shebang line by bmitc on Wednesday January 29, 2025 @05:02AM (#42863306)
> I think the fact that the uv tool itself is not written in Python

It's interesting that the language people choose to write systems with (Python) is basically identified as not the best language to write systems to support that language (Python).

To my knowledge, no other mainstream language has tooling predominantly written in another language.

Re:Using uv as your shebang line by disgruntledphd2 on Wednesday January 29, 2025 @05:22AM (#42863426)
gcc is written in C++ for like a decade now, so it's not completely unusual.
Re:Using uv as your shebang line by bmitc on Wednesday January 29, 2025 @05:24AM (#42863436)
It's a compiler for C, C++, and adjacent languages though.
Re:Using uv as your shebang line by disgruntledphd2 on Wednesday January 29, 2025 @07:14AM (#42864032)
Sure, but the point was a tool written in a different language. So the c part of gcc is another example of this issue.
Re:Using uv as your shebang line by kloop on Wednesday January 29, 2025 @08:22AM (#42864606)
I believe quite a bit of the JS tooling has been rewritten in other languages over the last decade or so
Re:Using uv as your shebang line by HelloNurse on Wednesday January 29, 2025 @11:54AM (#42867581)
It's important to use any other language to avoid even the theoretical possibility of bootstrapping complications. All languages that produce self-contained compiled executables are equally suitable for the task.
Re:Using uv as your shebang line by IshKebab on Wednesday January 29, 2025 @03:03PM (#42870376)
Javascript has quite a lot of tooling written in other (better) languages.

I think Javascript and Python stand out because they are both extremely popular and also not very good languages, especially their tooling. You're obviously going to get a load of people using Javascript and Python saying "why is Webpack/Pip so damn slow? I don't have any choice but to use this language because of the web/AI/my coworkers are idiots, so I may as well improve the tooling".

Re:Using uv as your shebang line by IshKebab on Tuesday January 28, 2025 @05:11PM (#42858732)
> Oh, yet another python dependency tool. I have used a handful of them, and they keep coming

Yeah that's my opinion of all the other Python dependency tools, but uv is the real deal. It's fast, well designed, it's actually a drop-in replacement for pip and it actually works.

> I guess no work is important enough until it gets a super fast CLI written in the language du jour and installed by piping curl into sh

Yeah it's pretty nice that it's written in Rust so it's fast and reliable, and piping curl into sh makes it easy to install. Huge upgrade compared to the rest of Python tooling which is slow, janky and hard to install. Seriously the official way to install a recent Python on Linux is to build it from source!

It's a shame curl | bash is the best option we have but it does at least work reliably. Maybe one day the Linux community will come up with something better.

Re:Using uv as your shebang line by alt187 on Tuesday January 28, 2025 @05:13PM (#42858770)
It's, er, "funny" how people used to make fun of `curl | sh` because of how lame it was, and now you have it everywhere because Rust decided that this should be the install.
Re:Using uv as your shebang line by mixmastamyk on Wednesday January 29, 2025 @01:12AM (#42862095)
There's a recent rust available in Fedora. That's what I use.
Re:Using uv as your shebang line by benediktwerner on Wednesday January 29, 2025 @03:50AM (#42862915)
You can also install rustup via your package manager and then use it as usual to manage your Rust installations. Though I guess in most cases, a single moderately recent Rust installation works just fine. But it's useful if you want/need to use Rust nightly for example.
Re:Using uv as your shebang line by IshKebab on Wednesday January 29, 2025 @11:47AM (#42867444)
> now you have it everywhere because Rust decided that this should be the install.

No, now you have it everywhere because the Linux community completely failed to come up with anything better.

Re:Using uv as your shebang line by tovej on Wednesday January 29, 2025 @05:08PM (#42871865)
What do you mean? Linux has multiple excellent packaging solutions, apt/dpkg, yum, PKGBUILD/pacman

If a developer can't be arsed to package their software, it's not the Linux community's fault

Re:Using uv as your shebang line by baq on Tuesday January 28, 2025 @05:23PM (#42858900)
uv is the tool, finally. We've been waiting for two decades and it really does basically everything right, no ifs or buts. You can scratch off the 'yet another' part.
Re:Using uv as your shebang line by epcoa on Tuesday January 28, 2025 @09:41PM (#42860877)
uv is not just a dependency tool. uv deals well with packages and dependency management (well), venvs, runtimes, and tools. It replaces all the other tools and works better in just about every way.
Re:Using uv as your shebang line by nsteel on Wednesday January 29, 2025 @04:46AM (#42863219)
What we have now, a load of different people developing a load of new (better!) tools, is surely what the PyPA had in mind when they developed their tooling standards. This is all going to plan. We've gotten new features and huge speedups far quicker this way.

I don't like changing out and learning new tools constantly, but if this is the cost of the recent rapid tooling improvements then it's a great price.

And best of all, it's entirely optional. You can even install it other ways. What exactly was your point here?