Readit News logoReadit News
deepakjois commented on Fun with uv and PEP 723   cottongeeks.com/articles/... · Posted by u/deepakjois
rednafi · 9 months ago
> Before this I used to prefer Go for one-off scripts because it was easy to create a self-contained binary executable.

I still do because:

- Go gives me a single binary

- Dependencies are statically linked

- I don’t need any third-party libs in most scenarios

- Many of my scripts make network calls, and Go has a better stdlib for HTTP/RPC/Socket work

- Better tooling (built-in formatter, no need for pytest, go vet is handy)

- Easy concurrency. Most of my scripts don’t need it, but when they do, it’s easier since I don’t have to fiddle with colored functions, external libs, or, worse, threads.

That said, uv is a great improvement over the previous status quo. But I don’t write Python scripts for reasons that go beyond just tooling. And since it’s not a standard tool, I worry that more things like this will come along and try to “improve” everything. Already scarred and tired in that area thanks to the JS ecosystem. So I tend to prefer stable, reliable, and boring tools over everything else. Right now, Go does that well enough for my scripting needs.

deepakjois · 9 months ago
(author of post here)

I still use both Go and Python. But Python gives me access to a lot more libraries that do useful stuff. For example the YouTube transcript example I wrote about in the article was only possible in Python because afaik Go doesn't have a decent library for transcript extraction.

deepakjois commented on Fun with uv and PEP 723   cottongeeks.com/articles/... · Posted by u/deepakjois
satvikpendem · 9 months ago
Very nice, I believe Rust is doing something similar too which is where I initially learned of this idea of single-file shell-type scripts in other languages (with dependency management included, which is how it differs from existing ways of writing single-file scripts in e.g. scripting languages) [0].

Hopefully more languages follow suit on this pattern as it can be extremely useful for many cases, such as passing gists around, writing small programs which might otherwise be written in shell scripts, etc.

[0] https://rust-lang.github.io/rfcs/3424-cargo-script.html

deepakjois commented on Fun with uv and PEP 723   cottongeeks.com/articles/... · Posted by u/deepakjois
Noumenon72 · 9 months ago
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?

deepakjois · 9 months ago
uvx is useful to run scripts inside PyPi packages. It does not support running Python scripts directly

You can use uvx run scripts with a combination of the --with flag to specify the dependencies and invoking python directly. For e.g

uvx --with youtube-transcript-api python transcript.py

But you wont get the benefit of PEP 723 metadata.

deepakjois commented on Ask HN: How do you manage your bookmarks?    · Posted by u/kayf
shane156 · 6 years ago
I have the same problem and have started using https://raindrop.io

Hope it serves you well

deepakjois · 6 years ago
I tried Raindrop.io and was impressed enough to get an annual subscription to it.

My main use case was to have a single place for all my bookmarks across Android, iOS, OS X and Linux, and across Firefox and Chrome.

Among all the solutions I evaluated, Raindrop.io had the best UX at the time.

u/deepakjois

KarmaCake day642December 20, 2007View Original