python: apply overrides and fix override system

This commit is contained in:
DavHau 2022-06-22 13:12:54 +02:00
parent bc029af0ae
commit 3aa7a1365d
3 changed files with 12 additions and 14 deletions

View File

@ -16,6 +16,6 @@
source = src;
})
// {
checks.x86_64-linux.aiohttp = self.packages.x86_64-linux.aiohttp;
checks.x86_64-linux.aiohttp = self.packages.x86_64-linux.main;
};
}

View File

@ -12,6 +12,7 @@
getSource,
packageVersions,
subsystemAttrs,
produceDerivation,
...
}: let
l = lib // builtins;
@ -22,14 +23,6 @@
then python.pkgs.buildPythonApplication
else python.pkgs.buildPythonPackage;
packageName =
if defaultPackageName == null
then
if subsystemAttrs.application
then "application"
else "environment"
else defaultPackageName;
allDependencySources' =
l.flatten
(l.mapAttrsToList
@ -44,8 +37,8 @@
(src: src.original or src)
allDependencySources';
package = buildFunc {
name = packageName;
package = produceDerivation defaultPackageName (buildFunc {
name = defaultPackageName;
src = getSource defaultPackageName defaultPackageVersion;
format = "setuptools";
buildInputs = pkgs.pythonManylinuxPackages.manylinux1;
@ -73,7 +66,7 @@
--no-cache \
$pipInstallFlags
'';
};
});
in {
packages.${defaultPackageName}.${defaultPackageVersion} = package;
};

View File

@ -131,14 +131,19 @@
overrideFuncs =
lib.mapAttrsToList
(funcName: func: {inherit funcName func;})
(lib.filterAttrs (n: v: lib.hasPrefix "override" n) condOverride);
(lib.filterAttrs (
n: v:
lib.hasPrefix "override" n
&& (! b.elem n ["overrideDerivation" "overridePythonAttrs"])
)
condOverride);
singleArgOverrideFuncs = let
availableFunctions =
lib.mapAttrs
(funcName: func: getOverrideFunctionArgs func)
(lib.filterAttrs
(funcName: func: lib.hasPrefix "override" funcName)
(funcName: func: lib.hasPrefix "override" funcName && funcName != "overrideDerivation" && funcName != "overridePythonAttrs")
base_derivation);
getOverrideFuncNameForAttrName = attrName: let