Remove hard-coded known build systems

We can attempt to dynamically fetch this from the python package set instead.
This commit is contained in:
adisbladis 2020-01-02 18:27:01 +00:00
parent 9b33e9e3b6
commit 03d439fed3
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7

10
lib.nix
View file

@ -60,14 +60,12 @@ let
{ pythonPackages
, pyProject
}: let
knownBuildSystems = {
"intreehooks:loader" = [ pythonPackages.intreehooks ];
"poetry.masonry.api" = [ pythonPackages.poetry ];
"" = [];
};
buildSystem = lib.getAttrFromPath [ "build-system" "build-backend" ] pyProject;
drvAttr = builtins.elemAt (builtins.split "\\.|:" buildSystem) 0;
in
knownBuildSystems.${buildSystem} or (throw "unsupported build system ${buildSystem}");
if buildSystem == "" then [] else (
[ pythonPackages.${drvAttr} or (throw "unsupported build system ${buildSystem}") ]
);
in
{