TIL: Bypass the virtualenv wrapper scripts altogether by using

uv init --script myscript.py
uv add --script myscript.py 'somemod'

And using the following shebang line in myscript.py

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

When you start myscript.py it will create a python virtualenv on the fly with uv docs.astral.sh/uv/guides/scrip

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.online/users/rvstaveren/statuses/114660626805425481 on your instance and quote it. (Note that quoting is not supported in Mastodon.)