From dd307c793588cdbfb5f759a91f337299a842f05d Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Sat, 9 Jan 2021 15:31:10 -0800 Subject: Use a custom directory for exposed Python packages Isolate snekbox's dependencies from the packages available within the Python interpreter. Disable Python's default behaviour of site-dependent manipulations of sys.path. The custom directory looks like a user site to allow `pip install --user` to work with it. However, snekbox will see it as simply an additional search path for modules rather than as a user site. Disable isolated mode (-I) because it implies (-E), which ignores PYTHON* environment variables. This conflicts with the reliance on `PYTHONPATH`. Specify `PYTHONUSERBASE` in the Dockerfile to make installing packages to expose more intuitive for users. Otherwise, they'd have to remember to set this variable every time they need to install something. --- scripts/.profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/.profile b/scripts/.profile index 9bf8e09..11c8d78 100644 --- a/scripts/.profile +++ b/scripts/.profile @@ -17,5 +17,5 @@ nsjpy() { nsjail \ --config "${NSJAIL_CFG:-/snekbox/config/snekbox.cfg}" \ $nsj_args -- \ - /usr/local/bin/python -Iqu -c "$@" + /usr/local/bin/python -Squ -c "$@" } -- cgit v1.2.3