Skip to content

Commit 5de041e

Browse files
authored
python3Packages.langgraph*: fix updateScript, upgrade to latest (#396103)
2 parents 57cf30d + b4bbe42 commit 5de041e

File tree

8 files changed

+192
-127
lines changed

8 files changed

+192
-127
lines changed

pkgs/development/python-modules/langgraph-checkpoint-postgres/default.nix

+19-14
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,33 @@
22
lib,
33
buildPythonPackage,
44
fetchFromGitHub,
5+
stdenvNoCC,
6+
7+
# build system
8+
poetry-core,
9+
10+
# dependencies
511
langgraph-checkpoint,
6-
langgraph-sdk,
7-
orjson,
12+
ormsgpack,
813
psycopg,
914
psycopg-pool,
10-
poetry-core,
11-
pythonOlder,
15+
16+
# testing
1217
pgvector,
1318
postgresql,
1419
postgresqlTestHook,
1520
pytestCheckHook,
1621
pytest-asyncio,
17-
stdenvNoCC,
22+
23+
# passthru
24+
nix-update-script,
1825
}:
1926

2027
buildPythonPackage rec {
2128
pname = "langgraph-checkpoint-postgres";
22-
version = "2.0.15";
29+
version = "2.0.19";
2330
pyproject = true;
2431

25-
disabled = pythonOlder "3.10";
26-
2732
src = fetchFromGitHub {
2833
owner = "langchain-ai";
2934
repo = "langgraph";
@@ -43,7 +48,7 @@ buildPythonPackage rec {
4348

4449
dependencies = [
4550
langgraph-checkpoint
46-
orjson
51+
ormsgpack
4752
psycopg
4853
psycopg-pool
4954
];
@@ -83,11 +88,11 @@ buildPythonPackage rec {
8388

8489
pythonImportsCheck = [ "langgraph.checkpoint.postgres" ];
8590

86-
passthru = {
87-
updateScript = langgraph-sdk.updateScript;
88-
89-
# multiple tags confuse the bulk updater
90-
skipBulkUpdate = true;
91+
passthru.updateScript = nix-update-script {
92+
extraArgs = [
93+
"--version-regex"
94+
"checkpointpostgres==(\\d+\\.\\d+\\.\\d+)"
95+
];
9196
};
9297

9398
meta = {

pkgs/development/python-modules/langgraph-checkpoint-sqlite/default.nix

+18-8
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,32 @@
22
lib,
33
buildPythonPackage,
44
fetchFromGitHub,
5-
langgraph-checkpoint,
5+
6+
# build system
7+
poetry-core,
8+
9+
# dependencies
610
aiosqlite,
11+
langgraph-checkpoint,
12+
13+
# testing
714
pytest-asyncio,
815
pytestCheckHook,
9-
langgraph-sdk,
10-
poetry-core,
16+
17+
# passthru
18+
nix-update-script,
1119
}:
1220

1321
buildPythonPackage rec {
1422
pname = "langgraph-checkpoint-sqlite";
15-
version = "2.0.5";
23+
version = "2.0.6";
1624
pyproject = true;
1725

1826
src = fetchFromGitHub {
1927
owner = "langchain-ai";
2028
repo = "langgraph";
2129
tag = "checkpointsqlite==${version}";
22-
hash = "sha256-8JNPKaaKDM7VROd1n9TDALN6yxKRz1CuAultBcqBMG0=";
30+
hash = "sha256-UUlrhQS0C2rPp//+LwU2rgR4R3AM5fM9X3CYvi/DAy8=";
2331
};
2432

2533
sourceRoot = "${src.name}/libs/checkpoint-sqlite";
@@ -45,9 +53,11 @@ buildPythonPackage rec {
4553
pytestCheckHook
4654
];
4755

48-
passthru = {
49-
inherit (langgraph-sdk) updateScript;
50-
skipBulkUpdate = true; # Broken, see https://github.com/NixOS/nixpkgs/issues/379898
56+
passthru.updateScript = nix-update-script {
57+
extraArgs = [
58+
"--version-regex"
59+
"checkpoint-sqlite==(\\d+\\.\\d+\\.\\d+)"
60+
];
5161
};
5262

5363
meta = {

pkgs/development/python-modules/langgraph-checkpoint/default.nix

+23-11
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,49 @@
11
{
22
lib,
33
buildPythonPackage,
4-
dataclasses-json,
54
fetchFromGitHub,
5+
6+
# build system
7+
poetry-core,
8+
9+
# dependencies
610
langchain-core,
7-
langgraph-sdk,
811
msgpack,
9-
poetry-core,
12+
ormsgpack,
13+
14+
# testing
15+
dataclasses-json,
1016
pytest-asyncio,
1117
pytest-mock,
1218
pytestCheckHook,
19+
20+
# passthru
21+
nix-update-script,
1322
}:
1423

1524
buildPythonPackage rec {
1625
pname = "langgraph-checkpoint";
17-
version = "2.0.16";
26+
version = "2.0.24";
1827
pyproject = true;
1928

2029
src = fetchFromGitHub {
2130
owner = "langchain-ai";
2231
repo = "langgraph";
2332
tag = "checkpoint==${version}";
24-
hash = "sha256-HieCzNM+z7d0UGL8QOyjNP5P2IbLf0x0xhaUCWM/c0k=";
33+
hash = "sha256-NlTpBXBeADlIHQDlt0muJEuoKOgXiAtAo8GoU5CsvZo=";
2534
};
2635

2736
sourceRoot = "${src.name}/libs/checkpoint";
2837

2938
build-system = [ poetry-core ];
3039

31-
dependencies = [ langchain-core ];
40+
dependencies = [
41+
langchain-core
42+
ormsgpack
43+
];
3244

3345
propagatedBuildInputs = [ msgpack ];
3446

35-
pythonRelaxDeps = [ "msgpack" ]; # Can drop after msgpack 1.0.10 lands in nixpkgs
36-
3747
pythonImportsCheck = [ "langgraph.checkpoint" ];
3848

3949
nativeCheckInputs = [
@@ -48,9 +58,11 @@ buildPythonPackage rec {
4858
"test_serde_jsonplus"
4959
];
5060

51-
passthru = {
52-
updateScript = langgraph-sdk.updateScript;
53-
skipBulkUpdate = true; # Broken, see https://github.com/NixOS/nixpkgs/issues/379898
61+
passthru.updateScript = nix-update-script {
62+
extraArgs = [
63+
"--version-regex"
64+
"checkpoint==(\\d+\\.\\d+\\.\\d+)"
65+
];
5466
};
5567

5668
meta = {

pkgs/development/python-modules/langgraph-cli/default.nix

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
{
22
lib,
33
buildPythonPackage,
4-
click,
54
fetchFromGitHub,
5+
6+
# build-system
67
poetry-core,
78

8-
# for update script
9-
langgraph-sdk,
9+
# dependencies
10+
click,
1011

1112
# testing
1213
pytest-asyncio,
1314
pytestCheckHook,
1415
docker-compose,
1516

16-
pythonOlder,
17+
# passthru
18+
nix-update-script,
1719
}:
1820

1921
buildPythonPackage rec {
2022
pname = "langgraph-cli";
21-
version = "0.1.74";
23+
version = "0.1.84";
2224
pyproject = true;
2325

24-
disabled = pythonOlder "3.10";
25-
2626
src = fetchFromGitHub {
2727
owner = "langchain-ai";
2828
repo = "langgraph";
2929
tag = "cli==${version}";
30-
hash = "sha256-9/lL2TyOPiRIy6PfWEcd2fBNjn3n3Rpg0/7DL/4+Qpc=";
30+
hash = "sha256-nb6u3YooDujRc6BKl35ZQPrKDlZkCreFn82TGxt4m5M=";
3131
};
3232

3333
sourceRoot = "${src.name}/libs/cli";
@@ -59,9 +59,11 @@ buildPythonPackage rec {
5959
"test_dockerfile_command_with_docker_compose"
6060
];
6161

62-
passthru = {
63-
inherit (langgraph-sdk) updateScript;
64-
skipBulkUpdate = true; # Broken, see https://github.com/NixOS/nixpkgs/issues/379898
62+
passthru.updateScript = nix-update-script {
63+
extraArgs = [
64+
"--version-regex"
65+
"cli==(\\d+\\.\\d+\\.\\d+)"
66+
];
6567
};
6668

6769
meta = {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
lib,
3+
stdenv,
4+
buildPythonPackage,
5+
fetchFromGitHub,
6+
7+
# build-system
8+
poetry-core,
9+
10+
# dependencies
11+
langchain-core,
12+
langgraph-checkpoint,
13+
14+
# tests
15+
langgraph-checkpoint-postgres,
16+
langgraph-checkpoint-sqlite,
17+
postgresql,
18+
postgresqlTestHook,
19+
psycopg-pool,
20+
psycopg,
21+
pytest-asyncio,
22+
pytest-mock,
23+
pytestCheckHook,
24+
25+
# passthru
26+
nix-update-script,
27+
}:
28+
# langgraph-prebuilt isn't meant to be a standalone package but is bundled into langgraph at build time.
29+
# It exists so the langgraph team can iterate on it without having to rebuild langgraph.
30+
buildPythonPackage rec {
31+
pname = "langgraph-prebuilt";
32+
version = "0.1.8";
33+
pyproject = true;
34+
35+
src = fetchFromGitHub {
36+
owner = "langchain-ai";
37+
repo = "langgraph";
38+
tag = "prebuilt==${version}";
39+
hash = "sha256-mYcj7HRbB5H6G0CVLOICKgdtR5Wlv9WeTIBjQJqlhOE=";
40+
};
41+
42+
sourceRoot = "${src.name}/libs/prebuilt";
43+
44+
build-system = [ poetry-core ];
45+
46+
dependencies = [
47+
langchain-core
48+
langgraph-checkpoint
49+
];
50+
51+
skipPythonImportsCheck = true; # This will be packaged with langgraph
52+
53+
# postgresql doesn't play nicely with the darwin sandbox:
54+
# FATAL: could not create shared memory segment: Operation not permitted
55+
doCheck = !stdenv.hostPlatform.isDarwin;
56+
57+
nativeCheckInputs = [
58+
pytestCheckHook
59+
postgresql
60+
postgresqlTestHook
61+
];
62+
63+
checkInputs = [
64+
langgraph-checkpoint
65+
langgraph-checkpoint-postgres
66+
langgraph-checkpoint-sqlite
67+
psycopg
68+
psycopg-pool
69+
pytest-asyncio
70+
pytest-mock
71+
];
72+
73+
preCheck = ''
74+
export PYTHONPATH=${src}/libs/langgraph:$PYTHONPATH
75+
'';
76+
77+
pytestFlagsArray = [
78+
"-W"
79+
"ignore::pytest.PytestDeprecationWarning"
80+
"-W"
81+
"ignore::DeprecationWarning"
82+
];
83+
84+
disabledTestPaths = [
85+
# psycopg.OperationalError: connection failed: connection to server at "127.0.0.1", port 5442 failed: Connection refused
86+
# Is the server running on that host and accepting TCP/IP connections?
87+
"tests/test_react_agent.py"
88+
];
89+
90+
passthru.updateScript = nix-update-script {
91+
extraArgs = [
92+
"--version-regex"
93+
"prebuilt==(\\d+\\.\\d+\\.\\d+)"
94+
];
95+
};
96+
97+
meta = {
98+
description = "Prebuilt agents add-on for Langgraph. Should always be bundled with langgraph";
99+
homepage = "https://github.com/langchain-ai/langgraph";
100+
changelog = "https://github.com/langchain-ai/langgraph/releases/tag/${version}";
101+
license = lib.licenses.mit;
102+
maintainers = with lib.maintainers; [ sarahec ];
103+
};
104+
}

0 commit comments

Comments
 (0)