diff --git a/.devops/nix/package-gguf-py.nix b/.devops/nix/package-gguf-py.nix index ee73150d4..24b42d446 100644 --- a/.devops/nix/package-gguf-py.nix +++ b/.devops/nix/package-gguf-py.nix @@ -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; diff --git a/.devops/nix/scope.nix b/.devops/nix/scope.nix index abef51fd3..4babfa448 100644 --- a/.devops/nix/scope.nix +++ b/.devops/nix/scope.nix @@ -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; };