Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at python-updates 95 lines 2.1 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 6 # build-system 7 hatchling, 8 9 # dependencies 10 click, 11 langgraph, 12 langgraph-runtime-inmem, 13 langgraph-sdk, 14 python-dotenv, 15 16 # testing 17 pytest-asyncio, 18 pytestCheckHook, 19 docker-compose, 20 21 # passthru 22 gitUpdater, 23}: 24 25buildPythonPackage rec { 26 pname = "langgraph-cli"; 27 version = "2.1.1"; 28 pyproject = true; 29 30 src = fetchFromGitHub { 31 owner = "langchain-ai"; 32 repo = "langgraph"; 33 tag = "checkpoint==${version}"; 34 hash = "sha256-UY3AChShKfOrtOQzOm5vi3Yy3rlBc+TAje9L2L6My/U="; 35 }; 36 37 sourceRoot = "${src.name}/libs/cli"; 38 39 build-system = [ hatchling ]; 40 41 dependencies = [ 42 click 43 langgraph-sdk 44 ]; 45 46 optional-dependencies = { 47 "inmem" = [ 48 langgraph 49 langgraph-runtime-inmem 50 python-dotenv 51 ]; 52 }; 53 54 nativeCheckInputs = [ 55 pytest-asyncio 56 pytestCheckHook 57 docker-compose 58 ] 59 ++ lib.flatten (builtins.attrValues optional-dependencies); 60 61 enabledTestPaths = [ "tests/unit_tests" ]; 62 63 pythonImportsCheck = [ "langgraph_cli" ]; 64 65 disabledTests = [ 66 # Flaky tests that generate a Docker configuration then compare to exact text 67 "test_config_to_docker_simple" 68 "test_config_to_docker_pipconfig" 69 "test_config_to_compose_env_vars" 70 "test_config_to_compose_env_file" 71 "test_config_to_compose_end_to_end" 72 "test_config_to_compose_simple_config" 73 "test_config_to_compose_watch" 74 75 # Tests that require docker 76 "test_dockerfile_command_with_docker_compose" 77 "test_build_command_with_api_version_and_base_image" 78 "test_build_command_with_api_version" 79 "test_build_generate_proper_build_context" 80 "test_build_command_shows_wolfi_warning" 81 ]; 82 83 passthru.updateScript = gitUpdater { 84 rev-prefix = "cli=="; 85 }; 86 87 meta = { 88 description = "Official CLI for LangGraph API"; 89 homepage = "https://github.com/langchain-ai/langgraph/tree/main/libs/cli"; 90 changelog = "https://github.com/langchain-ai/langgraph/releases/tag/${src.tag}"; 91 mainProgram = "langgraph"; 92 license = lib.licenses.mit; 93 maintainers = with lib.maintainers; [ sarahec ]; 94 }; 95}