buildPython*: unify the use of standard library function (#386449)

This commit is contained in:
Yueh-Shun Li
2025-03-07 00:28:00 +08:00
committed by GitHub
@@ -33,20 +33,21 @@ let
inherit (builtins) unsafeGetAttrPos;
inherit (lib)
elem
optionalString
max
stringLength
fixedWidthString
getName
optional
optionals
optionalAttrs
hasSuffix
escapeShellArgs
extendDerivation
fixedWidthString
flip
getName
hasSuffix
head
splitString
isBool
max
optional
optionalAttrs
optionals
optionalString
removePrefix
splitString
stringLength
;
leftPadName =
@@ -65,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"
@@ -88,12 +89,12 @@ let
]
);
isSetuptoolsDependency' = lib.flip elem [
isSetuptoolsDependency' = flip elem [
"setuptools"
"wheel"
];
cleanAttrs = lib.flip removeAttrs [
cleanAttrs = flip removeAttrs [
"disabled"
"checkPhase"
"checkInputs"
@@ -443,13 +444,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;
@@ -463,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