Add support for non-pyproject local dependencies

We were previously assuming that pyproject.toml always exists in a
local dependency.

This is not the case for setup.py.
This commit is contained in:
adisbladis 2020-08-21 13:58:31 +02:00
parent 3204df6699
commit 10e417df85
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7

View file

@ -47,10 +47,16 @@ pythonPackages.callPackage
isGit = isSource && source.type == "git";
isLocal = isSource && source.type == "directory";
localDepPath = toPath source.url;
pyProject = poetryLib.readTOML (localDepPath + "/pyproject.toml");
buildSystemPkgs = poetryLib.getBuildSystemPkgs {
inherit pythonPackages pyProject;
};
buildSystemPkgs =
let
pyProjectPath = localDepPath + "/pyproject.toml";
pyProject = poetryLib.readTOML pyProjectPath;
in
if builtins.pathExists pyProjectPath then poetryLib.getBuildSystemPkgs {
inherit pythonPackages pyProject;
} else [ ];
fileInfo =
let
isBdist = f: lib.strings.hasSuffix "whl" f.file;