5c370c0b2a
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
58 lines
1.1 KiB
Nix
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.0";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ollama";
|
|
repo = "ollama-python";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-kfotKUUXBekUd0X32BYAjNWvQJO94bdEDCSrBg2yJRQ=";
|
|
};
|
|
|
|
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 ];
|
|
};
|
|
}
|