build(nix): Enable pytestCheckHook and pythonImportsCheck for gguf-py

This commit is contained in:
ditsuke 2024-02-25 17:14:33 +05:30
parent 11e581b45d
commit 4b124fb2a4
No known key found for this signature in database
GPG key ID: 71B6C31C8A5A9D21
2 changed files with 16 additions and 2 deletions

View file

@ -4,6 +4,7 @@
numpy,
poetry-core,
buildPythonPackage,
pytestCheckHook,
}@inputs:
buildPythonPackage {
@ -13,7 +14,12 @@ buildPythonPackage {
nativeBuildInputs = [ poetry-core ];
propagatedBuildInputs = [ numpy ];
src = lib.cleanSource ../../gguf-py;
doCheck = false;
pythonImportsCheck = [
"numpy"
"gguf"
];
nativeCheckInputs = [ pytestCheckHook ];
doCheck = true;
meta = with lib; {
description = "Python package for writing binary files in the GGUF format";
license = licenses.mit;

View file

@ -10,6 +10,7 @@ let
buildPythonPackage = pythonPackages.buildPythonPackage;
numpy = pythonPackages.numpy;
poetry-core = pythonPackages.poetry-core;
pytestCheckHook = pythonPackages.pytestCheckHook;
in
# We're using `makeScope` instead of just writing out an attrset
@ -19,7 +20,14 @@ in
lib.makeScope newScope (self: {
inherit llamaVersion;
pp = python3.pkgs;
gguf-py = self.callPackage ./package-gguf-py.nix { inherit buildPythonPackage numpy poetry-core; };
gguf-py = self.callPackage ./package-gguf-py.nix {
inherit
buildPythonPackage
numpy
poetry-core
pytestCheckHook
;
};
llama-cpp = self.callPackage ./package.nix { };
docker = self.callPackage ./docker.nix { };
docker-min = self.callPackage ./docker.nix { interactive = false; };