Maybe it is a question for the #packaging category.
If I am not mistaken, it is indeed the installer (pip for example) who is in charge of writing the script wrapper. And I believe that in pip’s case, it is done by distlib.scripts
which is vendored in pip.
As far as I know pip does not offer any way to customize the shebang that it generates.
Related:
- How to define gui_scripts with isolated (-I) launch mode?
- Distlib’s design — Distlib 0.3.6 documentation
- pip/scripts.py at 23.0 · pypa/pip · GitHub
- pip wheel install scripts not respecting parameters after `#!python` · Issue #10661 · pypa/pip · GitHub
- Change script shebang replacement to respect args by mducle · Pull Request #10663 · pypa/pip · GitHub