python311Packages.ollama: init at 0.1.7

Ollama Python library

https://github.com/ollama/ollama-python
This commit is contained in:
Fabian Affolter 2024-03-19 18:38:39 +01:00
parent 85426e06d0
commit 2e2df99001
2 changed files with 66 additions and 0 deletions

View file

@ -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 ];
};
}

View file

@ -8845,6 +8845,8 @@ self: super: with self; {
oletools = callPackage ../development/python-modules/oletools { };
ollama = callPackage ../development/python-modules/ollama { };
omegaconf = callPackage ../development/python-modules/omegaconf { };
omemo-dr = callPackage ../development/python-modules/omemo-dr { };