Skip to content

Commit 93211b2

Browse files
author
anki
committed
python entrypoint + xonsh example
1 parent d579c13 commit 93211b2

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

appimage/recipes/xonsh.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export PYTHON_VERSION="3.7.3"
2+
export PIP_REQUIREMENTS="xonsh prompt_toolkit gnureadline Pygments"
3+
export PYTHON_ENTRYPOINT='"-u" "-c" "from xonsh.main import main; main()"'

linuxdeploy-plugin-python.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ script=$(readlink -f $0)
2020
exe_name="$(basename ${APPIMAGE:-$script})"
2121
BASEDIR="${APPDIR:-$(readlink -m $(dirname $script))}"
2222

23+
PYTHON_ENTRYPOINT="${PYTHON_ENTRYPOINT:-}"
2324

2425
# Parse the CLI
2526
show_usage () {
@@ -153,6 +154,7 @@ do
153154
cp "${BASEDIR}/share/python-wrapper.sh" "$python"
154155
sed -i "s|[{][{]PYTHON[}][}]|$python|g" "$python"
155156
sed -i "s|[{][{]PREFIX[}][}]|$prefix|g" "$python"
157+
sed -i "s|[{][{]ENTRYPOINT[}][}]|$PYTHON_ENTRYPOINT|g" "$python"
156158
fi
157159
done
158160

share/python-wrapper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ fi
3434
# Wrap the call to Python in order to mimic a call from the source
3535
# executable ($ARGV0), but potentially located outside of the Python
3636
# install ($PYTHONHOME)
37-
(PYTHONHOME="${APPDIR}/${prefix}" exec -a "${executable}" "$APPDIR/${prefix}/bin/${nickname}" "$@")
37+
(PYTHONHOME="${APPDIR}/${prefix}" exec -a "${executable}" "$APPDIR/${prefix}/bin/${nickname}" {{ENTRYPOINT}} "$@")
3838
exit "$?"

0 commit comments

Comments
 (0)