Add flag to disable PYTHONNOUSERSITE for wrapped python binaries
This commit is contained in:
@@ -46,6 +46,9 @@
|
||||
# Skip wrapping of python programs altogether
|
||||
, dontWrapPythonPrograms ? false
|
||||
|
||||
# Skip setting the PYTHONNOUSERSITE environment variable in wrapped programs
|
||||
, skipNoUserSite ? false
|
||||
|
||||
# Remove bytecode from bin folder.
|
||||
# When a Python script has the extension `.py`, bytecode is generated
|
||||
# Typically, executables in bin have no extension, so no bytecode is generated.
|
||||
@@ -93,6 +96,7 @@ let self = toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attr
|
||||
installCheckInputs = checkInputs;
|
||||
|
||||
postFixup = lib.optionalString (!dontWrapPythonPrograms) ''
|
||||
${if skipNoUserSite then "export SKIPNOUSERSITE=1" else ""}
|
||||
wrapPythonPrograms
|
||||
'' + lib.optionalString removeBinBytecode ''
|
||||
if [ -d "$out/bin" ]; then
|
||||
|
||||
Reference in New Issue
Block a user