<#1305 Support a direct execution entry point mode...
# github-notifications
c
#1305 Support a direct execution entry point mode. Issue created by jsirois Currently Pex does not support
python my/file.py
style execution. Instead you would tell pex
--entry-point "my.file"
. This almost always is fine, but in the important case of Django apps, importing
my.file
as a module can cause load order issues that cause Django to crash; whereas, executing
my/file.py
directly does no module importing up front, avoiding issues. A sketch might be: 1.
pex --entrypoint my/file.py -o my.pex
2.
pex --entrypoint my/file.py -D src/ -o my.pex
3.
pex --entry-point src/my/file -D src/ -o my.pex
In case 1 the file must exist at
$PWD/my/file.py
and will be added to the pex as
my/file.py
. In case 2 ... a few different semantics could be chosen. In case 3 the file must exist at
$PWD/src/my/file.py
and will be added to the pex as
my/file.py
along with the rest of the content in
src/
. At runtime - Pex would ensure at least the file to execute was extracted to disk so that a
python my/file.py
execution could be done. pantsbuild/pex