From bd2ecba62240d68ee3262fc9949ccd963180e02c Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Tue, 17 Sep 2024 09:29:16 -0700 Subject: [PATCH] Fix for py 3.9 --- libs/langgraph/langgraph/utils/aio.py | 8 +++++++- libs/langgraph/poetry.lock | 6 +++--- libs/langgraph/pyproject.toml | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/libs/langgraph/langgraph/utils/aio.py b/libs/langgraph/langgraph/utils/aio.py index 3d0f71e06..bcddd11e3 100644 --- a/libs/langgraph/langgraph/utils/aio.py +++ b/libs/langgraph/langgraph/utils/aio.py @@ -1,11 +1,17 @@ import asyncio +import sys + +PY_310 = sys.version_info >= (3, 10) class Queue(asyncio.Queue): async def wait(self): """If queue is empty, wait until an item is available.""" while self.empty(): - getter = self._get_loop().create_future() + if PY_310: + getter = self._get_loop().create_future() + else: + getter = self._loop.create_future() self._getters.append(getter) try: await getter diff --git a/libs/langgraph/poetry.lock b/libs/langgraph/poetry.lock index b6f161afa..ba50565a8 100644 --- a/libs/langgraph/poetry.lock +++ b/libs/langgraph/poetry.lock @@ -1238,7 +1238,7 @@ typing-extensions = ">=4.7" [[package]] name = "langgraph-checkpoint" -version = "1.0.9" +version = "1.0.10" description = "Library with base interfaces for LangGraph checkpoint savers." optional = false python-versions = "^3.9.0,<4.0" @@ -1255,7 +1255,7 @@ url = "../checkpoint" [[package]] name = "langgraph-checkpoint-postgres" -version = "1.0.6" +version = "1.0.7" description = "Library with a Postgres implementation of LangGraph checkpoint saver." optional = false python-versions = "^3.9.0,<4.0" @@ -3202,4 +3202,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = ">=3.9.0,<4.0" -content-hash = "f72e42e6f957927f9acf19a838ad5331eb2ed11f0e58df3a6d3240eafb3dc057" +content-hash = "73c2dec0a0e833ad8742ebfca86d8e3d602a8a63671a782d21d8e0079a02d448" diff --git a/libs/langgraph/pyproject.toml b/libs/langgraph/pyproject.toml index 655970f60..a583db910 100644 --- a/libs/langgraph/pyproject.toml +++ b/libs/langgraph/pyproject.toml @@ -28,7 +28,7 @@ pytest-repeat = "^0.9.3" langgraph-checkpoint = {path = "../checkpoint", develop = true} langgraph-checkpoint-sqlite = {path = "../checkpoint-sqlite", develop = true} langgraph-checkpoint-postgres = {path = "../checkpoint-postgres", develop = true} -psycopg = {extras = ["binary"], version = ">=3.0.0"} +psycopg = {extras = ["binary"], version = ">=3.0.0", python = ">=3.10"} uvloop = "^0.20.0" pyperf = "^2.7.0" py-spy = "^0.3.14"