From 7e1f654883711e756eaf128da749dc6c18100671 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Mon, 17 Feb 2025 06:41:22 +0800 Subject: [PATCH] buildPython*: format expressions --- .../python/mk-python-derivation.nix | 123 +++++++++--------- 1 file changed, 61 insertions(+), 62 deletions(-) diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index 1c5eddd453e4..1025d9a79516 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -121,86 +121,86 @@ lib.extendMkDerivation { extendDrvArgs = finalAttrs: -{ - # Build-time dependencies for the package - nativeBuildInputs ? [ ], + { + # Build-time dependencies for the package + nativeBuildInputs ? [ ], - # Run-time dependencies for the package - buildInputs ? [ ], + # Run-time dependencies for the package + buildInputs ? [ ], - # Dependencies needed for running the checkPhase. - # These are added to buildInputs when doCheck = true. - checkInputs ? [ ], - nativeCheckInputs ? [ ], + # Dependencies needed for running the checkPhase. + # These are added to buildInputs when doCheck = true. + checkInputs ? [ ], + nativeCheckInputs ? [ ], - # propagate build dependencies so in case we have A -> B -> C, - # C can import package A propagated by B - propagatedBuildInputs ? [ ], + # propagate build dependencies so in case we have A -> B -> C, + # C can import package A propagated by B + propagatedBuildInputs ? [ ], - # Python module dependencies. - # These are named after PEP-621. - dependencies ? [ ], - optional-dependencies ? { }, + # Python module dependencies. + # These are named after PEP-621. + dependencies ? [ ], + optional-dependencies ? { }, - # Python PEP-517 build systems. - build-system ? [ ], + # Python PEP-517 build systems. + build-system ? [ ], - # DEPRECATED: use propagatedBuildInputs - pythonPath ? [ ], + # DEPRECATED: use propagatedBuildInputs + pythonPath ? [ ], - # Enabled to detect some (native)BuildInputs mistakes - strictDeps ? true, + # Enabled to detect some (native)BuildInputs mistakes + strictDeps ? true, - outputs ? [ "out" ], + outputs ? [ "out" ], - # used to disable derivation, useful for specific python versions - disabled ? false, + # used to disable derivation, useful for specific python versions + disabled ? false, - # Raise an error if two packages are installed with the same name - # TODO: For cross we probably need a different PYTHONPATH, or not - # add the runtime deps until after buildPhase. - catchConflicts ? (python.stdenv.hostPlatform == python.stdenv.buildPlatform), + # Raise an error if two packages are installed with the same name + # TODO: For cross we probably need a different PYTHONPATH, or not + # add the runtime deps until after buildPhase. + catchConflicts ? (python.stdenv.hostPlatform == python.stdenv.buildPlatform), - # Additional arguments to pass to the makeWrapper function, which wraps - # generated binaries. - makeWrapperArgs ? [ ], + # Additional arguments to pass to the makeWrapper function, which wraps + # generated binaries. + makeWrapperArgs ? [ ], - # Skip wrapping of python programs altogether - dontWrapPythonPrograms ? false, + # Skip wrapping of python programs altogether + dontWrapPythonPrograms ? false, - # Don't use Pip to install a wheel - # Note this is actually a variable for the pipInstallPhase in pip's setupHook. - # It's included here to prevent an infinite recursion. - dontUsePipInstall ? false, + # Don't use Pip to install a wheel + # Note this is actually a variable for the pipInstallPhase in pip's setupHook. + # It's included here to prevent an infinite recursion. + dontUsePipInstall ? false, - # Skip setting the PYTHONNOUSERSITE environment variable in wrapped programs - permitUserSite ? false, + # Skip setting the PYTHONNOUSERSITE environment variable in wrapped programs + permitUserSite ? 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. - # However, some packages do provide executables with extensions, and thus bytecode is generated. - removeBinBytecode ? true, + # 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. + # However, some packages do provide executables with extensions, and thus bytecode is generated. + removeBinBytecode ? true, - # pyproject = true <-> format = "pyproject" - # pyproject = false <-> format = "other" - # https://github.com/NixOS/nixpkgs/issues/253154 - pyproject ? null, + # pyproject = true <-> format = "pyproject" + # pyproject = false <-> format = "other" + # https://github.com/NixOS/nixpkgs/issues/253154 + pyproject ? null, - # Several package formats are supported. - # "setuptools" : Install a common setuptools/distutils based package. This builds a wheel. - # "wheel" : Install from a pre-compiled wheel. - # "pyproject": Install a package using a ``pyproject.toml`` file (PEP517). This builds a wheel. - # "egg": Install a package from an egg. - # "other" : Provide your own buildPhase and installPhase. - format ? null, + # Several package formats are supported. + # "setuptools" : Install a common setuptools/distutils based package. This builds a wheel. + # "wheel" : Install from a pre-compiled wheel. + # "pyproject": Install a package using a ``pyproject.toml`` file (PEP517). This builds a wheel. + # "egg": Install a package from an egg. + # "other" : Provide your own buildPhase and installPhase. + format ? null, - meta ? { }, + meta ? { }, - doCheck ? true, + doCheck ? true, - ... -}@attrs: + ... + }@attrs: let getFinalPassthru = @@ -447,8 +447,7 @@ lib.extendMkDerivation { "enabledTestPaths" "enabledTests" ] attrs - ) - ; + ); # This derivation transformation function must be independent to `attrs` # for fixed-point arguments support in the future.