Replies: 2 comments
-
In a "happy path"1,
Footnotes
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I'd love to use console_scripts, unfortunately it generates an EXE and an EXE will be locked while running so I cannot use that to create a utility for upgrading my package, I can only use scripts. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Just looking at this code,
https://github.com/pypa/setuptools/blob/main/setuptools/_distutils/command/build_scripts.py
I didn't see anything in my wheel that explicitly executes this, so I assume it happens because setuptools gets installed and run by the pip command installing my wheel.
On Windows, my understanding is that any installed script will be executed by whatever interpreter happens to have registered itself with the .py file association. Which of course may not be interpreter that installed said script. So we have a problem because there's no guarantee that the script is compatible with whatever is running it.
So to work-around this issue, I think the only way to handle this is to just fall back on a minimal Python sub-set, write some code that loads sys.argv[0], searches for the hashbang, pulls it out, then uses that executable to re-launch the script again, being assured of the correct interpreter this time.
Am I missing some trick here?
Beta Was this translation helpful? Give feedback.
All reactions