mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 05:29:20 +03:00

Diff: https://github.com/langchain-ai/langchain/compare/refs/tags/langchain-core==0.3.35...langchain-core==0.3.43 Changelog: https://github.com/langchain-ai/langchain/releases/tag/v0.3.43
155 lines
5.7 KiB
Diff
155 lines
5.7 KiB
Diff
diff --git a/pyproject.toml b/pyproject.toml
|
|
index a2cfc7adf..db37bd74a 100644
|
|
--- a/pyproject.toml
|
|
+++ b/pyproject.toml
|
|
@@ -53,7 +53,7 @@ test = [
|
|
"responses<1.0.0,>=0.25.0",
|
|
"pytest-socket<1.0.0,>=0.7.0",
|
|
"pytest-xdist<4.0.0,>=3.6.1",
|
|
- "blockbuster~=1.5.18",
|
|
+ # "blockbuster~=1.5.18",
|
|
"numpy<2.0.0,>=1.24.0; python_version < \"3.12\"",
|
|
"numpy<3,>=1.26.0; python_version >= \"3.12\"",
|
|
"langchain-tests",
|
|
diff --git a/tests/unit_tests/conftest.py b/tests/unit_tests/conftest.py
|
|
index 6438c3037..aa301c337 100644
|
|
--- a/tests/unit_tests/conftest.py
|
|
+++ b/tests/unit_tests/conftest.py
|
|
@@ -5,35 +5,35 @@ from importlib import util
|
|
from uuid import UUID
|
|
|
|
import pytest
|
|
-from blockbuster import BlockBuster, blockbuster_ctx
|
|
+# from blockbuster import BlockBuster, blockbuster_ctx
|
|
from pytest import Config, Function, Parser
|
|
from pytest_mock import MockerFixture
|
|
|
|
|
|
-@pytest.fixture(autouse=True)
|
|
-def blockbuster() -> Iterator[BlockBuster]:
|
|
- with blockbuster_ctx("langchain_core") as bb:
|
|
- for func in ["os.stat", "os.path.abspath"]:
|
|
- (
|
|
- bb.functions[func]
|
|
- .can_block_in("langchain_core/_api/internal.py", "is_caller_internal")
|
|
- .can_block_in("langchain_core/runnables/base.py", "__repr__")
|
|
- .can_block_in(
|
|
- "langchain_core/beta/runnables/context.py", "aconfig_with_context"
|
|
- )
|
|
- )
|
|
-
|
|
- for func in ["os.stat", "io.TextIOWrapper.read"]:
|
|
- bb.functions[func].can_block_in(
|
|
- "langsmith/client.py", "_default_retry_config"
|
|
- )
|
|
-
|
|
- for bb_function in bb.functions.values():
|
|
- bb_function.can_block_in(
|
|
- "freezegun/api.py", "_get_cached_module_attributes"
|
|
- )
|
|
-
|
|
- yield bb
|
|
+# @pytest.fixture(autouse=True)
|
|
+# def blockbuster() -> Iterator[BlockBuster]:
|
|
+# with blockbuster_ctx("langchain_core") as bb:
|
|
+# for func in ["os.stat", "os.path.abspath"]:
|
|
+# (
|
|
+# bb.functions[func]
|
|
+# .can_block_in("langchain_core/_api/internal.py", "is_caller_internal")
|
|
+# .can_block_in("langchain_core/runnables/base.py", "__repr__")
|
|
+# .can_block_in(
|
|
+# "langchain_core/beta/runnables/context.py", "aconfig_with_context"
|
|
+# )
|
|
+# )
|
|
+
|
|
+# for func in ["os.stat", "io.TextIOWrapper.read"]:
|
|
+# bb.functions[func].can_block_in(
|
|
+# "langsmith/client.py", "_default_retry_config"
|
|
+# )
|
|
+
|
|
+# for bb_function in bb.functions.values():
|
|
+# bb_function.can_block_in(
|
|
+# "freezegun/api.py", "_get_cached_module_attributes"
|
|
+# )
|
|
+
|
|
+# yield bb
|
|
|
|
|
|
def pytest_addoption(parser: Parser) -> None:
|
|
diff --git a/tests/unit_tests/language_models/chat_models/test_rate_limiting.py b/tests/unit_tests/language_models/chat_models/test_rate_limiting.py
|
|
index ee6eefba9..4d39da58d 100644
|
|
--- a/tests/unit_tests/language_models/chat_models/test_rate_limiting.py
|
|
+++ b/tests/unit_tests/language_models/chat_models/test_rate_limiting.py
|
|
@@ -2,17 +2,17 @@ import time
|
|
from typing import Optional as Optional
|
|
|
|
import pytest
|
|
-from blockbuster import BlockBuster
|
|
+# from blockbuster import BlockBuster
|
|
|
|
from langchain_core.caches import InMemoryCache
|
|
from langchain_core.language_models import GenericFakeChatModel
|
|
from langchain_core.rate_limiters import InMemoryRateLimiter
|
|
|
|
|
|
-@pytest.fixture(autouse=True)
|
|
-def deactivate_blockbuster(blockbuster: BlockBuster) -> None:
|
|
- # Deactivate BlockBuster to not disturb the rate limiter timings
|
|
- blockbuster.deactivate()
|
|
+# @pytest.fixture(autouse=True)
|
|
+# def deactivate_blockbuster(blockbuster: BlockBuster) -> None:
|
|
+# # Deactivate BlockBuster to not disturb the rate limiter timings
|
|
+# blockbuster.deactivate()
|
|
|
|
|
|
def test_rate_limit_invoke() -> None:
|
|
diff --git a/tests/unit_tests/runnables/test_runnable_events_v2.py b/tests/unit_tests/runnables/test_runnable_events_v2.py
|
|
index e1e1f37b9..21d2f1600 100644
|
|
--- a/tests/unit_tests/runnables/test_runnable_events_v2.py
|
|
+++ b/tests/unit_tests/runnables/test_runnable_events_v2.py
|
|
@@ -15,7 +15,7 @@ from typing import (
|
|
)
|
|
|
|
import pytest
|
|
-from blockbuster import BlockBuster
|
|
+# from blockbuster import BlockBuster
|
|
from pydantic import BaseModel
|
|
|
|
from langchain_core.callbacks import CallbackManagerForRetrieverRun, Callbacks
|
|
@@ -2005,7 +2005,7 @@ EXPECTED_EVENTS = [
|
|
|
|
async def test_sync_in_async_stream_lambdas(blockbuster: BlockBuster) -> None:
|
|
"""Test invoking nested runnable lambda."""
|
|
- blockbuster.deactivate()
|
|
+ # blockbuster.deactivate()
|
|
|
|
def add_one(x: int) -> int:
|
|
return x + 1
|
|
diff --git a/tests/unit_tests/test_setup.py b/tests/unit_tests/test_setup.py
|
|
index 1df3c73a2..58e94de9a 100644
|
|
--- a/tests/unit_tests/test_setup.py
|
|
+++ b/tests/unit_tests/test_setup.py
|
|
@@ -1,15 +1,15 @@
|
|
import time
|
|
|
|
import pytest
|
|
-from blockbuster import BlockingError
|
|
+# from blockbuster import BlockingError
|
|
|
|
from langchain_core import sys_info
|
|
|
|
|
|
-async def test_blockbuster_setup() -> None:
|
|
- """Check if blockbuster is correctly setup."""
|
|
- # Blocking call outside of langchain_core is allowed.
|
|
- time.sleep(0.01) # noqa: ASYNC251
|
|
- with pytest.raises(BlockingError):
|
|
- # Blocking call from langchain_core raises BlockingError.
|
|
- sys_info.print_sys_info()
|
|
+# async def test_blockbuster_setup() -> None:
|
|
+# """Check if blockbuster is correctly setup."""
|
|
+# # Blocking call outside of langchain_core is allowed.
|
|
+# time.sleep(0.01) # noqa: ASYNC251
|
|
+# with pytest.raises(BlockingError):
|
|
+# # Blocking call from langchain_core raises BlockingError.
|
|
+# sys_info.print_sys_info()
|