587713944a
GitOrigin-RevId: 6143fc5eeb9c4f00163267708e26191d1e918932
64 lines
1.1 KiB
Nix
64 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.1.8";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ollama";
|
|
repo = "ollama-python";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-hMNoWalUL+5FzmV5ICj7Zl6cTWzE6xGWfTf5++c36+E=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace pyproject.toml \
|
|
--replace-fail "0.0.0" "${version}"
|
|
'';
|
|
|
|
pythonRelaxDeps = [
|
|
"httpx"
|
|
];
|
|
|
|
build-system = [
|
|
poetry-core
|
|
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 ];
|
|
};
|
|
}
|