From 70322e2fa27f5535013527b5ef0a8a40a409802a Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Sun, 2 Mar 2025 21:44:43 +0800 Subject: [PATCH 1/4] buildPythonPackage: format expression --- pkgs/development/interpreters/python/mk-python-derivation.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index 750f79f40661..09420fe778b0 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -443,13 +443,13 @@ let disabledTests = attrs.disabledTests; } // optionalAttrs (attrs ? pytestFlags) { - pytestFlags = attrs.pytestFlags; + pytestFlags = attrs.pytestFlags; } // optionalAttrs (attrs ? pytestFlagsArray) { pytestFlagsArray = attrs.pytestFlagsArray; } // optionalAttrs (attrs ? unittestFlags) { - unittestFlags = attrs.unittestFlags; + unittestFlags = attrs.unittestFlags; } // optionalAttrs (attrs ? unittestFlagsArray) { unittestFlagsArray = attrs.unittestFlagsArray; From 2aa22b5edc43cf04051610c81802e41602a2c9c4 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Sun, 2 Mar 2025 21:49:02 +0800 Subject: [PATCH 2/4] buildPythonPackage: remove obsolete lib inheritance --- pkgs/development/interpreters/python/mk-python-derivation.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index 09420fe778b0..db8fcbb027e2 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -42,7 +42,6 @@ let optionals optionalAttrs hasSuffix - escapeShellArgs extendDerivation head splitString From f2cbc7da9e0786d2c31fd6e8df2e771510c4b7ca Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Sun, 2 Mar 2025 21:51:24 +0800 Subject: [PATCH 3/4] buildPythonPackage: sort lib inheritance --- .../interpreters/python/mk-python-derivation.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index db8fcbb027e2..aefdd4aa11fb 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -33,19 +33,19 @@ let inherit (builtins) unsafeGetAttrPos; inherit (lib) elem - optionalString - max - stringLength + extendDerivation fixedWidthString getName - optional - optionals - optionalAttrs hasSuffix - extendDerivation head - splitString isBool + max + optional + optionalAttrs + optionals + optionalString + splitString + stringLength ; leftPadName = From ad8dfff2dd96c991e76dd5e18c63978899762482 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Sun, 2 Mar 2025 21:54:05 +0800 Subject: [PATCH 4/4] buildPythonPackage: add and use lib inheritance --- .../interpreters/python/mk-python-derivation.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index aefdd4aa11fb..b35356d4603b 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -35,6 +35,7 @@ let elem extendDerivation fixedWidthString + flip getName hasSuffix head @@ -44,6 +45,7 @@ let optionalAttrs optionals optionalString + removePrefix splitString stringLength ; @@ -64,18 +66,18 @@ let isMismatchedPython = drv: drv.pythonModule != python; - withDistOutput' = lib.flip elem [ + withDistOutput' = flip elem [ "pyproject" "setuptools" "wheel" ]; - isBootstrapInstallPackage' = lib.flip elem [ + isBootstrapInstallPackage' = flip elem [ "flit-core" "installer" ]; - isBootstrapPackage' = lib.flip elem ( + isBootstrapPackage' = flip elem ( [ "build" "packaging" @@ -87,12 +89,12 @@ let ] ); - isSetuptoolsDependency' = lib.flip elem [ + isSetuptoolsDependency' = flip elem [ "setuptools" "wheel" ]; - cleanAttrs = lib.flip removeAttrs [ + cleanAttrs = flip removeAttrs [ "disabled" "checkPhase" "checkInputs" @@ -462,7 +464,7 @@ let drv: extendDerivation ( drv.disabled - -> throw "${lib.removePrefix namePrefix drv.name} not supported for interpreter ${python.executable}" + -> throw "${removePrefix namePrefix drv.name} not supported for interpreter ${python.executable}" ) { } (toPythonModule drv); in