I'm also bullish on using them with Marimo notebooks as a replacement for Jupyter notebooks.
include a bin/run-python wrapper script in your project, and have that set environment variables and call the .venv/bin/python binary. done.
yes, i realise in replying to this comment i'm admitting that i'm part of the problem exactly described, but the "activate" script has caused more confusion in the long run than is worthwhile and the "running from a .venv/" directory could have been a much smaller problem instead of the wind-tunnel it has become.
#!/path/to/your/venv/bin/python
as first the line of your script, done/done
First, one often needs to set PYTHONPATH etc, and this is best done near the point of execution, in a wrapper script and not wangling around in ~/.bash_profile where it gets forgotten, and is not project-specific.
Secondly, and more importantly, your suggestion assumes the venv lives in a fixed location. This is unlikely to be the case.[1] What is preferable is something which is independent of filesystem location. The bin/run-python script is able to find its location on the filesystem, and the location of the venv relative to it.
[1] You might have a custom python distribution with a bunch of modules installed into a well-known location and therefore using that for the python in your application is a reasonable solution, but that is not what we are talking about here.
From the perspective of a user who just wants to install and use something, it doesn't matter why python is atrocious, it just is. Ideally, something like pipx would be far far better than it is, and bundled by default with the system python. Every venv should get added to a launcher that gives access to a shell, an IDE or any python program in the venv. In fact if the python venv module was just a teensy bit better it could (optionally, but by default) do this for you.