Commit 14b27b54 by Cyril Jouve Committed by GitHub

editable: exit script with callable return

This change ensures that generated scripts for editable package 
installs exit using return value from callable used.
parent 0d7b16f7
......@@ -27,10 +27,11 @@ if TYPE_CHECKING:
SCRIPT_TEMPLATE = """\
#!{python}
import sys
from {module} import {callable_holder}
if __name__ == '__main__':
{callable_}()
sys.exit({callable_}())
"""
WINDOWS_CMD_TEMPLATE = """\
......
......@@ -148,10 +148,11 @@ My Package
baz_script = """\
#!{python}
import sys
from bar import baz
if __name__ == '__main__':
baz.boom.bim()
sys.exit(baz.boom.bim())
""".format(
python=tmp_venv.python
)
......@@ -160,10 +161,11 @@ if __name__ == '__main__':
foo_script = """\
#!{python}
import sys
from foo import bar
if __name__ == '__main__':
bar()
sys.exit(bar())
""".format(
python=tmp_venv.python
)
......@@ -172,10 +174,11 @@ if __name__ == '__main__':
fox_script = """\
#!{python}
import sys
from fuz.foo import bar
if __name__ == '__main__':
bar.baz()
sys.exit(bar.baz())
""".format(
python=tmp_venv.python
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment