Unverified Commit 83b32add authored by Fabian Affolter's avatar Fabian Affolter Committed by GitHub
Browse files

Merge pull request #297421 from fabaff/ollama

python311Packages.ollama: init at 0.1.7
parents 11fc7cb8 2e2df990
Loading
Loading
Loading
Loading
+64 −0
Original line number Diff line number Diff line
{ 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 ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -8847,6 +8847,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 { };