2017-05-19 13:21:58 +01:00
|
|
|
addPythonPath() {
|
|
|
|
addToSearchPathWithCustomDelimiter : PYTHONPATH $1/@sitePackages@
|
|
|
|
}
|
|
|
|
|
|
|
|
toPythonPath() {
|
|
|
|
local paths="$1"
|
|
|
|
local result=
|
|
|
|
for i in $paths; do
|
|
|
|
p="$i/@sitePackages@"
|
|
|
|
result="${result}${result:+:}$p"
|
|
|
|
done
|
|
|
|
echo $result
|
|
|
|
}
|
|
|
|
|
2019-03-05 19:25:38 +00:00
|
|
|
if [ -z "${dontAddPythonPath:-}" ]; then
|
|
|
|
addEnvHooks "$hostOffset" addPythonPath
|
|
|
|
fi
|
2017-05-19 13:21:58 +01:00
|
|
|
|
|
|
|
# Determinism: The interpreter is patched to write null timestamps when compiling python files.
|
|
|
|
# This way python doesn't try to update them when we freeze timestamps in nix store.
|
|
|
|
export DETERMINISTIC_BUILD=1;
|
|
|
|
# Determinism: We fix the hashes of str, bytes and datetime objects.
|
|
|
|
export PYTHONHASHSEED=0;
|
2017-12-30 14:33:59 +00:00
|
|
|
# Determinism. Whenever Python is included, it should not check user site-packages.
|
|
|
|
# This option is only relevant when the sandbox is disabled.
|
|
|
|
export PYTHONNOUSERSITE=1;
|