summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/langgraph-cli/default.nix
blob: faaab1ce7e8067b11b899169edd95d34defcd580 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  hatchling,

  # dependencies
  click,
  langgraph-sdk,

  # testing
  pytest-asyncio,
  pytestCheckHook,
  docker-compose,

  # passthru
  gitUpdater,
}:

buildPythonPackage rec {
  pname = "langgraph-cli";
  version = "0.3.6";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "langchain-ai";
    repo = "langgraph";
    tag = "cli==${version}";
    hash = "sha256-tBMdFOHSRjw0PtE19XytLU4MmjR3NBLJxUqWoG4L2F8=";
  };

  sourceRoot = "${src.name}/libs/cli";

  build-system = [ hatchling ];

  dependencies = [
    click
    langgraph-sdk
  ];

  # Not yet. Depemnds on `langgraph-runtime-inmem` which isn't in github yet
  # https://github.com/langchain-ai/langgraph/issues/5802
  # optional-dependencies = {
  #   "inmem" = [
  #     langgraph-api
  #     langgraph-runtime-inmem
  #     python-dotenv
  #   ]
  # }

  nativeCheckInputs = [
    pytest-asyncio
    pytestCheckHook
    docker-compose
  ];

  enabledTestPaths = [ "tests/unit_tests" ];

  pythonImportsCheck = [ "langgraph_cli" ];

  disabledTests = [
    # Flaky tests that generate a Docker configuration then compare to exact text
    "test_config_to_docker_simple"
    "test_config_to_docker_pipconfig"
    "test_config_to_compose_env_vars"
    "test_config_to_compose_env_file"
    "test_config_to_compose_end_to_end"
    "test_config_to_compose_simple_config"
    "test_config_to_compose_watch"

    # Tests that require docker
    "test_dockerfile_command_with_docker_compose"
    "test_build_command_with_api_version_and_base_image"
    "test_build_command_with_api_version"
    "test_build_generate_proper_build_context"
    "test_build_command_shows_wolfi_warning"
  ];

  passthru.updateScript = gitUpdater {
    rev-prefix = "cli==";
  };

  meta = {
    description = "Official CLI for LangGraph API";
    homepage = "https://github.com/langchain-ai/langgraph/tree/main/libs/cli";
    changelog = "https://github.com/langchain-ai/langgraph/releases/tag/${version}";
    mainProgram = "langgraph";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ sarahec ];
  };
}