Something went wrong. Try again.
lol
Something went wrong. Try again.
4.0 kB · 161 lines
Nix
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162{ lib, stdenv, buildPythonPackage, fetchFromGitHub,
# build-system hatchling,
# dependencies langchain-core, langgraph-checkpoint, langgraph-prebuilt, langgraph-sdk, pydantic, xxhash,
# tests aiosqlite, dataclasses-json, fakeredis, grandalf, httpx, langgraph-checkpoint-postgres, langgraph-checkpoint-sqlite, langsmith, psycopg, pycryptodome, pytest-asyncio, pytest-mock, pytest-repeat, pytest-xdist, pytestCheckHook, syrupy, postgresql, postgresqlTestHook, redisTestHook,
# passthru nix-update-script,}:buildPythonPackage (finalAttrs: { pname = "langgraph"; version = "1.1.6"; pyproject = true;
src = fetchFromGitHub { owner = "langchain-ai"; repo = "langgraph"; tag = finalAttrs.version; hash = "sha256-9YuvzPmyNOfx8AolUaY8XFeYUpWRmudtLEAUadRUAqY="; };
postgresqlTestSetupPost = '' substituteInPlace tests/conftest_store.py \ --replace-fail "DEFAULT_POSTGRES_URI = \"postgres://postgres:postgres@localhost:5442/\"" "DEFAULT_POSTGRES_URI = \"postgres:///$PGDATABASE\"" substituteInPlace tests/conftest_checkpointer.py \ --replace-fail "DEFAULT_POSTGRES_URI = \"postgres://postgres:postgres@localhost:5442/\"" "DEFAULT_POSTGRES_URI = \"postgres:///$PGDATABASE\"" '';
sourceRoot = "${finalAttrs.src.name}/libs/langgraph";
build-system = [ hatchling ];
dependencies = [ langchain-core langgraph-checkpoint langgraph-prebuilt langgraph-sdk pydantic xxhash ];
pythonImportsCheck = [ "langgraph" ];
# postgresql doesn't play nicely with the darwin sandbox: # FATAL: could not create shared memory segment: Operation not permitted doCheck = !stdenv.hostPlatform.isDarwin;
nativeCheckInputs = [ pytestCheckHook postgresql postgresqlTestHook redisTestHook fakeredis langgraph-checkpoint ];
checkInputs = [ aiosqlite dataclasses-json grandalf httpx langgraph-checkpoint-postgres langgraph-checkpoint-sqlite langsmith psycopg psycopg.pool pycryptodome pydantic pytest-asyncio pytest-mock pytest-repeat pytest-xdist syrupy ];
disabledTests = [ # Requires `langgraph dev` to be running "test_remote_graph_basic_invoke" "test_remote_graph_stream_messages_tuple"
# Disabling tests that requires to create new random databases "test_cancel_graph_astream" "test_cancel_graph_astream_events_v2" "test_channel_values" "test_fork_always_re_runs_nodes" "test_interruption_without_state_updates" "test_interruption_without_state_updates_async" "test_invoke_two_processes_in_out_interrupt" "test_nested_graph_interrupts" "test_no_modifier_async" "test_no_modifier" "test_pending_writes_resume" "test_remove_message_via_state_update" "test_interrupt_functional_pydantic" ];
disabledTestPaths = [ # psycopg.errors.InsufficientPrivilege: permission denied to create database "tests/test_checkpoint_migration.py" "tests/test_large_cases.py" "tests/test_large_cases_async.py" "tests/test_pregel.py" "tests/test_pregel_async.py" "tests/test_subgraph_persistence.py" "tests/test_subgraph_persistence_async.py" "tests/test_time_travel.py" "tests/test_time_travel_async.py" ];
# Since `langgraph` is the only unprefixed package, we have to use an explicit match passthru = { # python updater script sets the wrong tag skipBulkUpdate = true; updateScript = nix-update-script { extraArgs = [ "--version-regex" "([0-9.]+)" ]; }; };
meta = { description = "Build resilient language agents as graphs"; homepage = "https://github.com/langchain-ai/langgraph"; changelog = "https://github.com/langchain-ai/langgraph/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ sarahec ]; };})