diff --git a/pkgs/development/python-modules/gguf/default.nix b/pkgs/development/python-modules/gguf/default.nix index d1bdd9313a7b..aa36e03af5b1 100644 --- a/pkgs/development/python-modules/gguf/default.nix +++ b/pkgs/development/python-modules/gguf/default.nix @@ -1,40 +1,54 @@ { lib, buildPythonPackage, - fetchPypi, - pythonOlder, - numpy, + fetchFromGitHub, + + # build-system poetry-core, + + # dependencies + numpy, + pyside6, pyyaml, sentencepiece, tqdm, + + # check inputs + pytestCheckHook, }: + buildPythonPackage rec { pname = "gguf"; version = "0.17.1"; - format = "pyproject"; + pyproject = true; - disabled = pythonOlder "3.7"; - - src = fetchPypi { - inherit pname version; - hash = "sha256-Nq1xqtkAo+dfyU6+lupgKfA6TkS+difvetPQPox7y1M="; + src = fetchFromGitHub { + owner = "ggml-org"; + repo = "llama.cpp"; + tag = "gguf-v${version}"; + hash = "sha256-XjDMDca4pyc72WQee4h3R6Iq9M0LzO+6ukV6CBWQO1M="; }; + sourceRoot = "${src.name}/gguf-py"; + + build-system = [ poetry-core ]; + dependencies = [ numpy - poetry-core + pyside6 pyyaml sentencepiece tqdm ]; + nativeCheckInputs = [ pytestCheckHook ]; + pythonImportsCheck = [ "gguf" ]; - meta = with lib; { + meta = { description = "Module for writing binary files in the GGUF format"; homepage = "https://ggml.ai/"; - license = licenses.mit; - maintainers = with maintainers; [ mitchmindtree ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ mitchmindtree ]; }; }