git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #91667 from DavHau/fix-indentation

mk-python-derivation.nix: fix indentation

commit7d03cf2c8d2ef8895719c4cc386ede0050f77cd0 authorLassulus <github@lassul.us> dateFri 21 Aug 2020, 17:07 (6 years ago) parent7a100add1c1a0c
1 file changed+77−77
pkgs/development/interpreters/python/mk-python-derivation.nix+77−77
pkgs/development/interpreters/python/mk-python-derivation.nix+77−77
@@ -105,81 +105,81 @@ let
105105 "disabled" "checkPhase" "checkInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "format"
106106 ]) // {
107107
108− name = namePrefix + name;
109−
110− nativeBuildInputs = [
111− python
112− wrapPython
113− ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)?
114− pythonRecompileBytecodeHook # Remove when solved https://github.com/NixOS/nixpkgs/issues/81441
115− pythonRemoveTestsDirHook
116− ] ++ lib.optionals catchConflicts [
117− setuptools pythonCatchConflictsHook
118− ] ++ lib.optionals removeBinBytecode [
119− pythonRemoveBinBytecodeHook
120− ] ++ lib.optionals (lib.hasSuffix "zip" (attrs.src.name or "")) [
121− unzip
122− ] ++ lib.optionals (format == "setuptools") [
123− setuptoolsBuildHook
124− ] ++ lib.optionals (format == "flit") [
125− flitBuildHook
126− ] ++ lib.optionals (format == "pyproject") [
127− pipBuildHook
128− ] ++ lib.optionals (format == "wheel") [
129− wheelUnpackHook
130− ] ++ lib.optionals (format == "egg") [
131− eggUnpackHook eggBuildHook eggInstallHook
132− ] ++ lib.optionals (!(format == "other") || dontUsePipInstall) [
133− pipInstallHook
134− ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [
135− # This is a test, however, it should be ran independent of the checkPhase and checkInputs
136− pythonImportsCheckHook
137− ] ++ lib.optionals (python.pythonAtLeast "3.3") [
138− # Optionally enforce PEP420 for python3
139− pythonNamespacesHook
140− ] ++ nativeBuildInputs;
141−
142− buildInputs = buildInputs ++ pythonPath;
143−
144− propagatedBuildInputs = propagatedBuildInputs ++ [ python ];
145−
146− inherit strictDeps;
147−
148− LANG = "${if python.stdenv.isDarwin then "en_US" else "C"}.UTF-8";
149−
150− # Python packages don't have a checkPhase, only an installCheckPhase
151− doCheck = false;
152− doInstallCheck = attrs.doCheck or true;
153− installCheckInputs = [
154− ] ++ lib.optionals (format == "setuptools") [
155− # Longer-term we should get rid of this and require
156− # users of this function to set the `installCheckPhase` or
157− # pass in a hook that sets it.
158− setuptoolsCheckHook
159− ] ++ checkInputs;
160−
161− postFixup = lib.optionalString (!dontWrapPythonPrograms) ''
162− wrapPythonPrograms
163− '' + attrs.postFixup or '''';
164−
165− # Python packages built through cross-compilation are always for the host platform.
166− disallowedReferences = lib.optionals (python.stdenv.hostPlatform != python.stdenv.buildPlatform) [ python.pythonForBuild ];
167−
168− # For now, revert recompilation of bytecode.
169− dontUsePythonRecompileBytecode = true;
170−
171− meta = {
172− # default to python's platforms
173− platforms = python.meta.platforms;
174− isBuildPythonPackage = python.meta.platforms;
175− } // meta;
176−} // lib.optionalAttrs (attrs?checkPhase) {
177− # If given use the specified checkPhase, otherwise use the setup hook.
178− # Longer-term we should get rid of `checkPhase` and use `installCheckPhase`.
179− installCheckPhase = attrs.checkPhase;
180−}));
181−
182−passthru.updateScript = let
183− filename = builtins.head (lib.splitString ":" self.meta.position);
184− in attrs.passthru.updateScript or [ update-python-libraries filename ];
108+ name = namePrefix + name;
109+
110+ nativeBuildInputs = [
111+ python
112+ wrapPython
113+ ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)?
114+ pythonRecompileBytecodeHook # Remove when solved https://github.com/NixOS/nixpkgs/issues/81441
115+ pythonRemoveTestsDirHook
116+ ] ++ lib.optionals catchConflicts [
117+ setuptools pythonCatchConflictsHook
118+ ] ++ lib.optionals removeBinBytecode [
119+ pythonRemoveBinBytecodeHook
120+ ] ++ lib.optionals (lib.hasSuffix "zip" (attrs.src.name or "")) [
121+ unzip
122+ ] ++ lib.optionals (format == "setuptools") [
123+ setuptoolsBuildHook
124+ ] ++ lib.optionals (format == "flit") [
125+ flitBuildHook
126+ ] ++ lib.optionals (format == "pyproject") [
127+ pipBuildHook
128+ ] ++ lib.optionals (format == "wheel") [
129+ wheelUnpackHook
130+ ] ++ lib.optionals (format == "egg") [
131+ eggUnpackHook eggBuildHook eggInstallHook
132+ ] ++ lib.optionals (!(format == "other") || dontUsePipInstall) [
133+ pipInstallHook
134+ ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [
135+ # This is a test, however, it should be ran independent of the checkPhase and checkInputs
136+ pythonImportsCheckHook
137+ ] ++ lib.optionals (python.pythonAtLeast "3.3") [
138+ # Optionally enforce PEP420 for python3
139+ pythonNamespacesHook
140+ ] ++ nativeBuildInputs;
141+
142+ buildInputs = buildInputs ++ pythonPath;
143+
144+ propagatedBuildInputs = propagatedBuildInputs ++ [ python ];
145+
146+ inherit strictDeps;
147+
148+ LANG = "${if python.stdenv.isDarwin then "en_US" else "C"}.UTF-8";
149+
150+ # Python packages don't have a checkPhase, only an installCheckPhase
151+ doCheck = false;
152+ doInstallCheck = attrs.doCheck or true;
153+ installCheckInputs = [
154+ ] ++ lib.optionals (format == "setuptools") [
155+ # Longer-term we should get rid of this and require
156+ # users of this function to set the `installCheckPhase` or
157+ # pass in a hook that sets it.
158+ setuptoolsCheckHook
159+ ] ++ checkInputs;
160+
161+ postFixup = lib.optionalString (!dontWrapPythonPrograms) ''
162+ wrapPythonPrograms
163+ '' + attrs.postFixup or '''';
164+
165+ # Python packages built through cross-compilation are always for the host platform.
166+ disallowedReferences = lib.optionals (python.stdenv.hostPlatform != python.stdenv.buildPlatform) [ python.pythonForBuild ];
167+
168+ # For now, revert recompilation of bytecode.
169+ dontUsePythonRecompileBytecode = true;
170+
171+ meta = {
172+ # default to python's platforms
173+ platforms = python.meta.platforms;
174+ isBuildPythonPackage = python.meta.platforms;
175+ } // meta;
176+ } // lib.optionalAttrs (attrs?checkPhase) {
177+ # If given use the specified checkPhase, otherwise use the setup hook.
178+ # Longer-term we should get rid of `checkPhase` and use `installCheckPhase`.
179+ installCheckPhase = attrs.checkPhase;
180+ }));
181+
182+ passthru.updateScript = let
183+ filename = builtins.head (lib.splitString ":" self.meta.position);
184+ in attrs.passthru.updateScript or [ update-python-libraries filename ];
185185in lib.extendDerivation true passthru self