Suppose I have a Python script that I want to distribute (not necessarily on PyPI, but I want people to be able to use pip to install it, e.g., with pip install . in a source checkout, or with pip install https://github.com/project/project/archive/master.zip).
Furthermore, I am excited about Python’s UTF-8 mode, finally allowing me to (mostly) not care about encodings anymore, because I adhere to the principle that the world should use UTF-8 ALWAYS, UTF-8 EVERYWHERE, UTF-8 ONLY.
Is there any way to ensure that when pip creates the wrapper for my script, it passes -X utf8 to the Python interpreter?
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.
“You can pass an optional options dictionary to the make() method. This is meant to contain options which control script generation.”
" interpreter_args : If provided, this should be a list of strings which are added to the shebang line following the interpreter. If there are values with spaces, you will need to surround them with double quotes."
So – how to tell pip what you want it to do?? But it may not be pip directly, it may be how the wheel is built … so ??
Yes, you are more likely to find help in the Packaging topic – or on the pip (or setuptools or poetry or ??) gitHub issues.