From d1c1a0c656ccd8bd3b25d3c4287f2d075faf3cf3 Mon Sep 17 00:00:00 2001 From: DavHau Date: Sat, 27 Jun 2020 14:26:03 +0000 Subject: fix indentation in mk-python-derivation.nix --- .../interpreters/python/mk-python-derivation.nix | 154 ++++++++++----------- 1 file changed, 77 insertions(+), 77 deletions(-) (limited to 'pkgs/development/interpreters/python') diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index a632efa416e..df945c645a8 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -105,81 +105,81 @@ let "disabled" "checkPhase" "checkInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "format" ]) // { - name = namePrefix + name; - - nativeBuildInputs = [ - python - wrapPython - ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)? - pythonRecompileBytecodeHook # Remove when solved https://github.com/NixOS/nixpkgs/issues/81441 - pythonRemoveTestsDirHook - ] ++ lib.optionals catchConflicts [ - setuptools pythonCatchConflictsHook - ] ++ lib.optionals removeBinBytecode [ - pythonRemoveBinBytecodeHook - ] ++ lib.optionals (lib.hasSuffix "zip" (attrs.src.name or "")) [ - unzip - ] ++ lib.optionals (format == "setuptools") [ - setuptoolsBuildHook - ] ++ lib.optionals (format == "flit") [ - flitBuildHook - ] ++ lib.optionals (format == "pyproject") [ - pipBuildHook - ] ++ lib.optionals (format == "wheel") [ - wheelUnpackHook - ] ++ lib.optionals (format == "egg") [ - eggUnpackHook eggBuildHook eggInstallHook - ] ++ lib.optionals (!(format == "other") || dontUsePipInstall) [ - pipInstallHook - ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ - # This is a test, however, it should be ran independent of the checkPhase and checkInputs - pythonImportsCheckHook - ] ++ lib.optionals (python.pythonAtLeast "3.3") [ - # Optionally enforce PEP420 for python3 - pythonNamespacesHook - ] ++ nativeBuildInputs; - - buildInputs = buildInputs ++ pythonPath; - - propagatedBuildInputs = propagatedBuildInputs ++ [ python ]; - - inherit strictDeps; - - LANG = "${if python.stdenv.isDarwin then "en_US" else "C"}.UTF-8"; - - # Python packages don't have a checkPhase, only an installCheckPhase - doCheck = false; - doInstallCheck = attrs.doCheck or true; - installCheckInputs = [ - ] ++ lib.optionals (format == "setuptools") [ - # Longer-term we should get rid of this and require - # users of this function to set the `installCheckPhase` or - # pass in a hook that sets it. - setuptoolsCheckHook - ] ++ checkInputs; - - postFixup = lib.optionalString (!dontWrapPythonPrograms) '' - wrapPythonPrograms - '' + attrs.postFixup or ''''; - - # Python packages built through cross-compilation are always for the host platform. - disallowedReferences = lib.optionals (python.stdenv.hostPlatform != python.stdenv.buildPlatform) [ python.pythonForBuild ]; - - # For now, revert recompilation of bytecode. - dontUsePythonRecompileBytecode = true; - - meta = { - # default to python's platforms - platforms = python.meta.platforms; - isBuildPythonPackage = python.meta.platforms; - } // meta; -} // lib.optionalAttrs (attrs?checkPhase) { - # If given use the specified checkPhase, otherwise use the setup hook. - # Longer-term we should get rid of `checkPhase` and use `installCheckPhase`. - installCheckPhase = attrs.checkPhase; -})); - -passthru.updateScript = let - filename = builtins.head (lib.splitString ":" self.meta.position); - in attrs.passthru.updateScript or [ update-python-libraries filename ]; + name = namePrefix + name; + + nativeBuildInputs = [ + python + wrapPython + ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)? + pythonRecompileBytecodeHook # Remove when solved https://github.com/NixOS/nixpkgs/issues/81441 + pythonRemoveTestsDirHook + ] ++ lib.optionals catchConflicts [ + setuptools pythonCatchConflictsHook + ] ++ lib.optionals removeBinBytecode [ + pythonRemoveBinBytecodeHook + ] ++ lib.optionals (lib.hasSuffix "zip" (attrs.src.name or "")) [ + unzip + ] ++ lib.optionals (format == "setuptools") [ + setuptoolsBuildHook + ] ++ lib.optionals (format == "flit") [ + flitBuildHook + ] ++ lib.optionals (format == "pyproject") [ + pipBuildHook + ] ++ lib.optionals (format == "wheel") [ + wheelUnpackHook + ] ++ lib.optionals (format == "egg") [ + eggUnpackHook eggBuildHook eggInstallHook + ] ++ lib.optionals (!(format == "other") || dontUsePipInstall) [ + pipInstallHook + ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ + # This is a test, however, it should be ran independent of the checkPhase and checkInputs + pythonImportsCheckHook + ] ++ lib.optionals (python.pythonAtLeast "3.3") [ + # Optionally enforce PEP420 for python3 + pythonNamespacesHook + ] ++ nativeBuildInputs; + + buildInputs = buildInputs ++ pythonPath; + + propagatedBuildInputs = propagatedBuildInputs ++ [ python ]; + + inherit strictDeps; + + LANG = "${if python.stdenv.isDarwin then "en_US" else "C"}.UTF-8"; + + # Python packages don't have a checkPhase, only an installCheckPhase + doCheck = false; + doInstallCheck = attrs.doCheck or true; + installCheckInputs = [ + ] ++ lib.optionals (format == "setuptools") [ + # Longer-term we should get rid of this and require + # users of this function to set the `installCheckPhase` or + # pass in a hook that sets it. + setuptoolsCheckHook + ] ++ checkInputs; + + postFixup = lib.optionalString (!dontWrapPythonPrograms) '' + wrapPythonPrograms + '' + attrs.postFixup or ''''; + + # Python packages built through cross-compilation are always for the host platform. + disallowedReferences = lib.optionals (python.stdenv.hostPlatform != python.stdenv.buildPlatform) [ python.pythonForBuild ]; + + # For now, revert recompilation of bytecode. + dontUsePythonRecompileBytecode = true; + + meta = { + # default to python's platforms + platforms = python.meta.platforms; + isBuildPythonPackage = python.meta.platforms; + } // meta; + } // lib.optionalAttrs (attrs?checkPhase) { + # If given use the specified checkPhase, otherwise use the setup hook. + # Longer-term we should get rid of `checkPhase` and use `installCheckPhase`. + installCheckPhase = attrs.checkPhase; + })); + + passthru.updateScript = let + filename = builtins.head (lib.splitString ":" self.meta.position); + in attrs.passthru.updateScript or [ update-python-libraries filename ]; in lib.extendDerivation true passthru self -- cgit 1.4.1