diff options
Diffstat (limited to 'nixpkgs/pkgs/development/interpreters/python/hooks/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/interpreters/python/hooks/default.nix | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/interpreters/python/hooks/default.nix b/nixpkgs/pkgs/development/interpreters/python/hooks/default.nix index 4d736426f3b..d14eb9cbb09 100644 --- a/nixpkgs/pkgs/development/interpreters/python/hooks/default.nix +++ b/nixpkgs/pkgs/development/interpreters/python/hooks/default.nix @@ -1,5 +1,6 @@ # Hooks for building Python packages. { python +, lib , callPackage , makeSetupHook , disabledIf @@ -97,6 +98,16 @@ in rec { }; } ./python-namespaces-hook.sh) {}; + pythonRecompileBytecodeHook = callPackage ({ }: + makeSetupHook { + name = "python-recompile-bytecode-hook"; + substitutions = { + inherit pythonInterpreter pythonSitePackages; + compileArgs = lib.concatStringsSep " " (["-q" "-f" "-i -"] ++ lib.optionals isPy3k ["-j $NIX_BUILD_CORES"]); + bytecodeName = if isPy3k then "__pycache__" else "*.pyc"; + }; + } ./python-recompile-bytecode-hook.sh ) {}; + pythonRemoveBinBytecodeHook = callPackage ({ }: makeSetupHook { name = "python-remove-bin-bytecode-hook"; |