diff --git a/mk-poetry-dep.nix b/mk-poetry-dep.nix index 7c76919..29597ba 100644 --- a/mk-poetry-dep.nix +++ b/mk-poetry-dep.nix @@ -46,6 +46,7 @@ pythonPackages.callPackage isSource = source != null; isGit = isSource && source.type == "git"; isUrl = isSource && source.type == "url"; + isWheelUrl = isSource && source.type == "url" && lib.strings.hasSuffix ".whl" source.url; isDirectory = isSource && source.type == "directory"; isFile = isSource && source.type == "file"; isLegacy = isSource && source.type == "legacy"; @@ -94,7 +95,7 @@ pythonPackages.callPackage else (builtins.elemAt (lib.strings.splitString "-" name) 2); }; - format = if isDirectory || isGit || isUrl then "pyproject" else fileInfo.format; + format = if isWheelUrl then "wheel" else if isDirectory || isGit || isUrl then "pyproject" else fileInfo.format; hooks = python.pkgs.callPackage ./hooks { }; in @@ -181,6 +182,12 @@ pythonPackages.callPackage } )) ) + else if isWheelUrl then + builtins.fetchurl + { + inherit (source) url; + sha256 = fileInfo.hash; + } else if isUrl then builtins.fetchTarball {