Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It can. That's what uv is. Put an '#!/usr/bin/env -S uv run python' shebang in your script, add a `pyproject.toml` with all of your deps, and you're done.


> add a `pyproject.toml` with all of your deps

Or put your dependencies inline in the script (https://packaging.python.org/en/latest/specifications/inline...), and it's just a single file script again. But with dependency support

EDIT to clarify it was just the pyproject.toml that inline metadata could replace


Again, you're creating a new session with special environmental variables. It's nice that it uses pyproject.toml (well, except for the toml part), but it still needs uv.

I was suggesting that the Python executable have this sort of functionality built in, with no need for a new session.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: