depot/third_party/nixpkgs/pkgs/development/python-modules/ollama/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

58 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
httpx,
pillow,
poetry-core,
pytest-asyncio,
pytest-httpserver,
pytestCheckHook,
pythonOlder,
pythonRelaxDepsHook,
}:
buildPythonPackage rec {
pname = "ollama";
version = "0.2.1";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "ollama";
repo = "ollama-python";
rev = "refs/tags/v${version}";
hash = "sha256-+1qhmz5WehbtjE+Dh/WTsqpiAmTjJg+tBjvYRQYkYy0=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "0.0.0" "${version}"
'';
pythonRelaxDeps = [ "httpx" ];
build-system = [ poetry-core ];
nativeBuildInputs = [ pythonRelaxDepsHook ];
dependencies = [ 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 ];
};
}