diff --git a/examples/python/flake.nix b/examples/python/flake.nix index 2f8d132d..9f8b9abc 100644 --- a/examples/python/flake.nix +++ b/examples/python/flake.nix @@ -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; }; } diff --git a/src/subsystems/python/builders/simple-builder/default.nix b/src/subsystems/python/builders/simple-builder/default.nix index 7d1a2bbd..096893ac 100644 --- a/src/subsystems/python/builders/simple-builder/default.nix +++ b/src/subsystems/python/builders/simple-builder/default.nix @@ -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; }; diff --git a/src/utils/override.nix b/src/utils/override.nix index d8df9be8..1a2888a7 100644 --- a/src/utils/override.nix +++ b/src/utils/override.nix @@ -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