Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at gcc-offload 55 lines 1.1 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 httpx, 6 pillow, 7 poetry-core, 8 pytest-asyncio, 9 pytest-httpserver, 10 pytestCheckHook, 11 pythonOlder, 12}: 13 14buildPythonPackage rec { 15 pname = "ollama"; 16 version = "0.3.3"; 17 pyproject = true; 18 19 disabled = pythonOlder "3.8"; 20 21 src = fetchFromGitHub { 22 owner = "ollama"; 23 repo = "ollama-python"; 24 rev = "refs/tags/v${version}"; 25 hash = "sha256-27OJwPvHBxCdaiHk8EQ2s1OeBzgsrzp1MjgKHNgvz+A="; 26 }; 27 28 postPatch = '' 29 substituteInPlace pyproject.toml \ 30 --replace-fail "0.0.0" "${version}" 31 ''; 32 33 pythonRelaxDeps = [ "httpx" ]; 34 35 build-system = [ poetry-core ]; 36 37 dependencies = [ httpx ]; 38 39 nativeCheckInputs = [ 40 pillow 41 pytest-asyncio 42 pytest-httpserver 43 pytestCheckHook 44 ]; 45 46 pythonImportsCheck = [ "ollama" ]; 47 48 meta = with lib; { 49 description = "Ollama Python library"; 50 homepage = "https://github.com/ollama/ollama-python"; 51 changelog = "https://github.com/ollama/ollama-python/releases/tag/v${version}"; 52 license = licenses.mit; 53 maintainers = with maintainers; [ fab ]; 54 }; 55}