diff --git a/pkgs/development/python-modules/llama-cloud/default.nix b/pkgs/development/python-modules/llama-cloud/default.nix index d33c235c3d60..36d6f9150c96 100644 --- a/pkgs/development/python-modules/llama-cloud/default.nix +++ b/pkgs/development/python-modules/llama-cloud/default.nix @@ -2,32 +2,67 @@ lib, buildPythonPackage, fetchPypi, + hatchling, + hatch-fancy-pypi-readme, + pythonOlder, + pythonAtLeast, + + # Dependencies httpx, - poetry-core, pydantic, anyio, + distro, + sniffio, + + # Test dependencies + pytestCheckHook, + pytest-asyncio, + pytest-xdist, + dirty-equals, + respx, + llama-index-core, }: buildPythonPackage (finalAttrs: { pname = "llama-cloud"; - version = "0.1.45"; + version = "1.6.0"; pyproject = true; src = fetchPypi { pname = "llama_cloud"; inherit (finalAttrs) version; - hash = "sha256-FAJEAIzFcQ4xrpfGBDlzo6mWmlGw84FV+jOoQ0B46Ko="; + hash = "sha256-sAx133a1m+zKcvJix1WllSnwwJ8M2nnghu7e/GLVmsg="; }; - build-system = [ poetry-core ]; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "hatchling==1.26.3" "hatchling>=1.26.3" + ''; + + build-system = [ + hatchling + hatch-fancy-pypi-readme + ]; dependencies = [ httpx pydantic + distro + sniffio + anyio ]; - # Module has no tests - doCheck = false; + nativeCheckInputs = [ + pytestCheckHook + pytest-asyncio + pytest-xdist + dirty-equals + respx + ] + ++ lib.optional (pythonOlder "3.14") llama-index-core; + + # Transitively requires google-pasta (broken on 3.14) through llama-index-core + disabledTestPaths = lib.optional (pythonAtLeast "3.14") "tests/test_index.py"; pythonImportsCheck = [ "llama_cloud" ];