diff options
author | Fabian Affolter <fabian@affolter-engineering.ch> | 2024-03-20 13:18:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-20 13:18:45 +0100 |
commit | 83b32addf230a48b6f4f9717fa8b4285b77244d5 (patch) | |
tree | eebae85c5217340cf7600f623de013c799bd8579 /pkgs/development | |
parent | 11fc7cb8d9d429c06710de725ff893b873b9cd22 (diff) | |
parent | 2e2df99001cf5f216e6381ada798311feab83792 (diff) |
Merge pull request #297421 from fabaff/ollama
python311Packages.ollama: init at 0.1.7
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/python-modules/ollama/default.nix | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/ollama/default.nix b/pkgs/development/python-modules/ollama/default.nix new file mode 100644 index 0000000000000..5e46474e11291 --- /dev/null +++ b/pkgs/development/python-modules/ollama/default.nix @@ -0,0 +1,64 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, httpx +, pillow +, poetry-core +, pytest-asyncio +, pytest-httpserver +, pytestCheckHook +, pythonOlder +, pythonRelaxDepsHook +}: + +buildPythonPackage rec { + pname = "ollama"; + version = "0.1.7"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "ollama"; + repo = "ollama-python"; + rev = "refs/tags/v${version}"; + hash = "sha256-xNH9kAjSdVXrCI7zkyR7tYxJ/NG8/08ykkDZQJI8Za4="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "0.0.0" "${version}" + ''; + + pythonRelaxDeps = [ + "httpx" + ]; + + nativeBuildInputs = [ + poetry-core + pythonRelaxDepsHook + ]; + + propagatedBuildInputs = [ + httpx + ]; + + nativeCheckInputs = [ + pillow + pytest-asyncio + pytest-httpserver + pytestCheckHook + ]; + + pythonImportsCheck = [ + "ollama" + ]; + + meta = with lib; { + description = "Ollama Python library"; + homepage = "https://github.com/ollama/ollama-python"; + changelog = "https://github.com/ollama/ollama-python/releases/tag/v${version}"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} |