frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Lena

https://qntm.org/mmacevedo
2•metadat•4m ago•1 comments

Workers of Snopes.com won voluntary recognition of their union, the Snopes Guild

https://newsguild.org/workers-at-snopes-com-win-voluntary-union-recognition/
2•giuliomagnifico•5m ago•0 comments

Kioxia LC9 SSD Hits 245.76TB of Capacity in a Single Drive

https://www.servethehome.com/kioxia-lc9-ssd-hits-245-76tb-of-capacity-in-a-single-drive/
2•LorenDB•9m ago•0 comments

Show HN: Best AI Tool Finder

https://bestaitoolfinder.com/
1•ShinMatsura•9m ago•0 comments

Interactive RAG Tools Infographic

https://claude.ai/public/artifacts/b872435b-1d9c-461e-a29c-b03d252053a0
1•Norcim133•12m ago•0 comments

Show HN: Code Mind Maps – A Fresh Perspective on Code Navigation

https://github.com/OlegIGalkin/Code-Mind-Map
2•kentich•15m ago•0 comments

Show HN: AI Curated Feeds for Programmers

https://www.pixelstech.net/feed/
2•misonic•16m ago•1 comments

(Gradient) Descent into Mediocrity

https://hey.paris/posts/tasmanai/
1•parisidau•17m ago•0 comments

South Korea Plans to Build a Moon Base by 2045

https://www.bgr.com/1918157/south-korea-moon-base-2045/
1•Bluestein•18m ago•0 comments

Fastgron High-performance JSON to GRON (greppable, flattened JSON) converter

https://github.com/adamritter/fastgron
1•Bluestein•26m ago•0 comments

Devenv 1.8: Progress TUI, SecretSpec, Listing Tasks, and Smaller Containers

https://devenv.sh/blog/2025/07/22/devenv-18-progress-tui-secretspec-integration-listing-tasks-and-smaller-containers/
1•domenkozar•29m ago•0 comments

Show HN: GoodBargainDeals – AI Summaries and Filters for Amazon Today's Deals

https://goodbargaindeals.com
1•abdullahsahin•31m ago•0 comments

Munchy Box

https://en.wikipedia.org/wiki/Munchy_box
1•CarbonBasedUnit•32m ago•1 comments

Reengineered carbon-to-acetylene process with negative carbon emission (2023)

https://pubs.rsc.org/en/content/articlehtml/2023/gc/d3gc01775c
2•blacksqr•32m ago•0 comments

FlightStream – An Arrow Flight-Based Server and Client Framework for Node.js

https://github.com/ggauravr/flightstream
1•ggauravr•37m ago•0 comments

Rill Social – free native iOS app just launched – husband and wife team

https://apps.apple.com/us/app/rill-social/id6736891148
1•ashstell•41m ago•1 comments

Show HN: Typogram Studio – Figma for Typography

https://typogram.co/studio/
1•wentin•44m ago•0 comments

What I Learned about Gardening from My PhD in Computer Science

https://www.theexclusive.org/2025/07/phd-gardener.html
1•qianli_cs•52m ago•0 comments

Heavyweight: An Art Project About Lawyer Vibes

https://kendraalbert.com/2025/07/21/lawyer-letters-without-lawyers.html
1•skogstokig•1h ago•0 comments

We Have Made the Decision to Not Continue Paying for BBB Accreditation

https://mycherrytree.com/blogs/news/why-we-have-made-the-decision-to-not-continue-paying-for-accreditation-from-the-better-business-bureau-bbb
10•LorenDB•1h ago•1 comments

Smoots: A fraternity prank turned into a measurement

https://www.theregister.com/2025/07/18/smoot_mit_measurement/
3•LorenDB•1h ago•0 comments

Anthropic CEO Says the Company Will Pursue Gulf State Investments After All

https://www.wired.com/story/anthropic-dario-amodei-gulf-state-leaked-memo/
5•ExMachina73•1h ago•1 comments

Detecting Organic Contaminants with Less Data

https://mirawelner.com/posts/spectroscopy.html
1•mirawelner•1h ago•0 comments

Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support

https://socket.dev/blog/bun-1-2-19-adds-isolated-installs-for-better-monorepo-support
2•feross•1h ago•0 comments

ZLUDA - CUDA on Non-Nvidia GPUs

https://github.com/vosen/ZLUDA
3•danboarder•1h ago•0 comments

Scan and resolve fixed GitHub issues and PRs with AI

https://github.com/ashleywolf/continuous-ai-resolver
1•gfysfm•1h ago•0 comments

Diffusion Beats Autoregressive in Data-Constrained Settings

https://arxiv.org/abs/2507.15857
2•georgehe9•1h ago•0 comments

Bill to Restrict AI Companies Unauthorized Use of Copyrighted Works for Training

https://deadline.com/2025/07/senate-bill-ai-copyright-1236463986/
8•OutOfHere•1h ago•0 comments

To combat climate change, Norway wants to be Europe's carbon dump

https://www.washingtonpost.com/climate-solutions/2025/07/21/carbon-capture-northern-lights-terminal/
3•darkknight107•1h ago•0 comments

Apparent Security Incident at Toptal

https://twitter.com/blackbigswan/status/1947464763786547530
2•feross•1h ago•0 comments
Open in hackernews

Uv: Running a script with dependencies

https://docs.astral.sh/uv/guides/scripts/#running-a-script-with-dependencies
160•Bluestein•4h ago

Comments

gopalv•4h ago
This is my absolute favourite uv features and the reason I switched to uv.

I have a bunch of scripts in my git-hooks which have dependencies which I don't want in my main venv.

#!/usr/bin/env -S uv run --script --python 3.13

This single feature meant that I could use the dependencies without making its own venv, but just include "brew install uv" as instructions to the devs.

Bluestein•4h ago
I honestly believe this is a killer (killer) feature.-
dwood_dev•3h ago
Completely agree. UV for stalled what was going to be a major project to move lots of python to golang. There will still be a lot migrated, but smaller script like things are no longer in scope.
abdusco•1h ago
I still write small some scripts in golang when the bootup time is important. Python still takes its time to boot up, and it's not the best tool for the job if it's gonna be called like a shell utility for thousands of files, for example.
alkh•2h ago
If I may interject, does anyone have any idea why the `-S` flag is required? Testing this out on my machine with a BSD env, `/usr/bin/env -S uv run --python 3.11 python` and `/usr/bin/env uv run --python 3.11 python` do the same thing (launch a Python interactive shell). Man page for env doesn't clarify a lot to me, as the end result still seems to be the same("Split apart the given string into multiple strings, and process each of the resulting strings as separate arguments to the env utility...")
Hello71•2h ago
https://en.wikipedia.org/wiki/Shebang_(Unix)#Argument_splitt...
alkh•2h ago
Thanks, but the main question is how come the behaviour is still the same whether you pass the flag or not? I would get it if it just failed without "-S" but it works as intended. I am wondering if this is cause I might not be using the GNU version of env, so this is less relevant? Edit: looks to be the version thing indeed, this doesn't work for someone on Ubuntu
fc417fc802•2h ago
At some point coreutils added -S in order to support the behavior of BSD and MacOS. I would guess that whatever implementation you're using then added -S as a noop in order to (at long last) permit the portable usage of multi-argument shebang lines. Until both of those things happened there was no portable way to pass multiple arguments in a shebang. You used to have to do really stupid things (ex https://unix.stackexchange.com/a/399698).

https://www.gnu.org/software/coreutils/manual/html_node/env-...

alkh•1h ago
Actually, you might be onto something! If I test with explicit quoting in terminal, BSD and GNU produce the same behavior:(`env 'bash -c "echo hello"'` fails while `env -S 'bash -c "echo hello"'`) works. I wasn't aware of this:

"To test env -S on the command line, use single quotes for the -S string to emulate a single parameter. Single quotes are not needed when using env -S in a shebang line on the first line of a script (the operating system already treats it as one argument)"(from your second link).

This is different for shebang on Mac though:

GNU env works with or without '-S':

#!/opt/homebrew/bin/genv -S bash -v

echo "hello world!"

BSD env works with or without '-S' too:

#!/usr/bin/env -S bash -v

echo "hello world!"

To conclude, looks like adding `-S` is the safest option for comparability sake :).

Skunkleton•2h ago
Its needed on my ubuntu 24.04 system

  $ cat test.sh
  #!/usr/bin/env bash -c "echo hello"
  $ ./test.sh
  /usr/bin/env: ‘bash -c "echo hello"’: No such file or directory
  /usr/bin/env: use -[v]S to pass options in shebang lines
  $ ./test.sh # with -S
  hello
alkh•2h ago
Interesting, I guess it is indeed a BSD thing, cause this works for me with or without '-S' on Mac
simonw•4h ago
The "declaring script dependencies" thing is incredibly useful: https://docs.astral.sh/uv/guides/scripts/#declaring-script-d...

  # /// script
  # dependencies = [
  #   "requests<3",
  #   "rich",
  # ]
  # ///
  import requests, rich
  # ... script goes here
Save that as script.py and you can use "uv run script.py" to run it with the specified dependencies, magically installed into a temporary virtual environment without you having to think about them at all.

It's an implementation of Python PEP 723: https://peps.python.org/pep-0723/

Claude 4 actually knows about this trick, which means you can ask it to write you a Python script "with inline script dependencies" and it will do the right thing, e.g. https://claude.ai/share/1217b467-d273-40d0-9699-f6a38113f045 - the prompt there was:

  Write a Python script with inline script
  dependencies that uses httpx and click to
  download a large file and show a progress bar
Prior to Claude 4 I had a custom Claude project that included special instructions on how to do this, but that's not necessary any more: https://simonwillison.net/2024/Dec/19/one-shot-python-tools/
minimaxir•3h ago
I thought that was a heart emoticon next to requests, for a second.
tayloramurphy•3h ago
I mean, who doesn't love requests?
tczMUFlmoNk•2h ago
Well... maybe the people who have stopped working on it due to the mysterious disappearance of 30,000 fundraised dollars, selling paid support but "delegat[ing] the actual work to unpaid volunteers", and a pattern of other issues from other community members who have not spoken up about them.

https://vorpus.org/blog/why-im-not-collaborating-with-kennet...

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

patcon•1h ago
> he said his original goal was just to raise $5k to buy a computer. Privately, I was skeptical that the $5k computer had anything to do with Requests. Requests is a small pure-Python library; if you want to work on it, then any cheap laptop is more than sufficient. $5k is the price of a beefy server or top-end gaming rig.

Kenneth Reitz has probably done more to enrich my life than most anyone else who builds things. I wouldn't begrudge him the idea of a nice workstation for his years of labour. Yeah, he's very imperfect, but the author has absolutely lost me

bb88•1h ago
Kenneth Reitz has been good and bad at times. And while things of his are genius level, he also has done asshole level things. But on the other hand, we get that with a lot of geniuses for some reason or another. Really smart people can be really dumb too.

It would be like saying, "Don't use Laplace transforms because he did some unsavory thing at some point in time."

kstrauser•41m ago
What has he built that you like using that much? Honest question, not being snarky.

I liked Requests way back when but prefer httpx or aiohttp. I liked piping for about a month when it first came out, but jumped ship pretty quickly. I'm not familiar with his other works.

I also wouldn't begrudge the guy a laptop, but I do get what the author was saying. His original fundraiser felt off, like, if you want a nice laptop, just say so, but don't create specious justifications for it.

selcuka•8m ago
> I liked Requests way back when but prefer httpx or aiohttp.

Those two tools are modeled after `requests`, so Reitz still has an influence in your life even if you don't use his implementation directly.

js2•1h ago
I've noticed that Claude Code prefers httpx because it's typed.
mikepurvis•13m ago
I really like httpx’s handling of clients/sessions; it’s super easy to throw one in a context manager and then get multiple hits to the same server all reusing one http2 connection.
JimDabell•40m ago
It stopped accepting new features a decade ago, it doesn’t support HTTP/2, let alone HTTP/3, it doesn’t support async, and the maintainers ignored the latest security vulnerability for eight months.

It was good when it was new but it’s dangerously unmaintained today and nobody should be using it any more. Use niquests, httpx, or aiohttp. Niquests has a compatible API if you need a drop-in replacement.

meander_water•3h ago
PEP723 is also supported by pipx and hatch, even though uv is (deservedly) getting all the attention these days.

Others like pip-tools have support in the roadmap (https://github.com/jazzband/pip-tools/issues/2027)

slt2021•2h ago
shebang mode is also incredibly useful and allows execution like ./script.sh

  #!/usr/bin/env -S uv run --script
  # /// script
  # dependencies = [
  #   "requests<3",
  #   "rich",
  # ]
  # ///
  import requests, rich
  # ... script goes here
ImJasonH•8m ago
This is cool!

This gave me the questionable idea of doing the same sort of thing for Go: https://github.com/imjasonh/gos

(Not necessarily endorsing, I was just curious to see how it would go, and it worked out okay!)

satertek•3h ago
Why doesn't pip support PEP 723? I'm all for spreading the love of our lord and savior uv, but it should be necessary to have an official implementation.
simonw•3h ago
I don't know if there's an official reason, but my guess is that it's slightly out of scope for pip: pip is a packaging installation tool, not a virtual environment managing system.

uv, being both, is a more natural fit for an implementation of that PEP.

Here's a relevant discussion: https://discuss.python.org/t/idea-introduce-standardize-proj...

Humphrey•3h ago
Oh this looks amazing! I had pretty much stopped using Python for my one-off scripts because of the hassle of dependencies. I can't wait to try this out.
bb88•1h ago
I've played with it for a while now, and for one off scripts where python might make more sense than bash, e.g., I write the script this way with uv, and then I only need uv and the script.

One of the complaints about python is that a script stops working over time (because the python installation changes with os updates), and this kinda sorta doesn't make it go away entirely, but what it does do is to eliminate a bunch of the hassle to getting things to work.

nomel•28m ago
Am I crazy for having my default interactive shell "/bin/env python" point to a virtual environment with all the random dependencies that my one off scripts need, so I can just run "python oneoneoff.py"? All of my one off scripts combined use maybe a dozen dependencies. If I need more, I just install them there. I use pyenv, so it's trivial to change the version of python that the interactive shell uses (default or temporary within the current shell).

From my perspective, people seem to make it difficult to use python, more from not understanding the difference between interactive shell and non-interactive shell configurations (if you think the above breaks system tools that use python, then you don't understand the difference, nor that system tools use /bin/python rather than /usr/env python), with a bit of cargo-cult mixed in, more than anything.

m4r71n•3h ago
Oh nice, I was already a happy user of the uv-specific shebang with in-script dependencies, but the `uv lock --script example.py` command to create a lock file that is specific to one script takes it to another level! Amazing how this feels so natural and yet only appeared after 20+ years of Python packaging.
billyjmc•57m ago
What’s your use case for locking dependencies on a single script?

One things that’s useful to my organization is that we can then proceed to scan the lockfile’s declared dependencies with, e.g., `trivy fs uv.lock` to make sure we’re not running code with known CVEs.

AceJohnny2•2h ago
Note that this only works for single-file scripts.

If you have a project with modules, and you'd like a module to declare its dependencies, this won't work. uv will only get those dependencies declared in the invoked file.

For a multi-file project, you must have a `pyproject.toml`, see https://docs.astral.sh/uv/guides/projects/#managing-dependen...

In both cases, the script/project writer can use `uv add <dependency>`, just in the single-file case they must add `--script`.

heisenzombie•2h ago
Quick plug here for a simple Jupyter kernel I created:

https://github.com/tobinjones/uvkernel

It’s a pretty minimal wrapper around “uv” and “iPython” to provide the functionality from the article, but for Jupyter notebooks. It’s similar to other projects, but I think my implementation is the least intrusive and a good “citizen” of the Jupyter ecosystem.

There’s also this work-in-progress:

https://github.com/tobinjones/pep723widget

Which provides a companion Jupyter plugin to manage the embedded script dependencies of noteboooks with a UI. Warning — this one is partially vibe-coded and very early days.

rented_mule•28m ago
There is also marimo. For my use cases it has been a fantastic upgrade from Jupyter. I use it in the style of TFA (notebooks are just Python files). In the notebook UI, you can add packages to the script headers. It's so nice to have many notebooks in one directory with independent, but reproducible environments.

Marimo notebooks are easy to diff when committing to git. Plus you get AI coding assistants in the notebook, a reactive UI framework, the ability to run in the browser with Pyodide on WASM, and more. It will also translate your old Jupyter notebooks for you.

For me, what uv is to package managers, marimo is to notebooks.

https://docs.astral.sh/uv/guides/integration/marimo/

Svoka•2h ago
More comments the topic - https://news.ycombinator.com/item?id=44369388

Fun with uv and PEP 723

640 points | 227 comments

rr808•2h ago
How many package managers can one language have? Its a simple language but setting it up is just incredibly bad. Maybe this is the one or should I wait for the next?
xyse53•2h ago
I recommend trying it, it gets a ton of hype but I think for good reason.

This is the one.

roywiggins•1h ago
imo all I usually need is pip-tools and venv, but uv kind of bundles the two together in a very natural way (and is very fast)
nomel•12m ago
Unless you're installing a new version of python, I have trouble seeing how preceding all the normal command with "uv" can be seen as much of a difference.
imcritic•2h ago
I hate such poor docs that don't explain how things work, and instead prefer hiding behind some "magic".

> Constraints can be added to the requested dependency if specific versions are needed:

> uv run --with 'rich>12,<13' example.py

Why not mention that this will make uv download specified versions of specified packages somewhere on the disk. Where? Are those packages going to get cached somewhere? Or will it re-download those same packages again and again every time you run this command?

frosting1337•2h ago
I mean... it's in the docs?

https://docs.astral.sh/uv/concepts/cache/

Technetium•2h ago
Caching linked on the left: https://docs.astral.sh/uv/concepts/cache/ The index of the Concepts section says: "Looking for a quick introduction to features? See the guides instead."

Maybe there should instead be a link to the Concepts section for people who want more details, but I feel it's fine as it is.

trostaft•2h ago
This is pretty great. Passing python code out to my students is usually also confronted with the question of "How do I run it?", which is usually terrible to answer. Now, I can just tell them to get uv (single command) and run it.
SafeDusk•1h ago
I am using this feature in my MCP servers and it is a god send! Some details on how I do it can be found at https://blog.toolkami.com/toolkami-shttp-server/.
bb88•1h ago
There's a lot of small one off things where deploying uv and the script makes it easy to use. A lot of use cases for golang can be replaced with uv.
hamandcheese•1h ago
My favorite part of this is the `exclude-newer` feature, giving you a somewhat reproducible script for very low effort.
jbaber•1h ago
I just looked this up yesterday by sheer coincidence and was happy it actually worked. What brought it to your attention today?
mdaniel•52m ago
Almost certainly the thread about jqfmt: https://news.ycombinator.com/item?id=44637716
hoherd•1h ago
One gotcha I caught myself in with this technique is using it in a script that would remediate a situation where my home has lost internet and needed the router to be power cycled. When the internet is out, `uv` cannot download the dependencies specified in the script, and the script would fail. Thankfully I noticed this problem after writing it but before needing it to actually work, and refactored my setup to pre-install the needed dependencies. But don't make the same mistake I almost made! Don't use this for code that may need to run airgapped! Even with uv caching you may still get a cache miss.
staplung•17m ago
Love this feature of UV. Here's a one-liner to launch jupyter notebook without even "installing" it:

  uv run --with jupyter jupyter notebook
Everything is put into a temporary virtual environment that's cleaned up afterwards. Best thing is that if you run it from a project it will pick up those dependencies as well.