mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-16 22:49:25 +03:00
python3Packages.langchain-core: 0.3.49 -> 0.3.56
Diff: https://github.com/langchain-ai/langchain/compare/langchain-core%3D%3D0.3.49...langchain-core%3D%3D0.3.56
This commit is contained in:
parent
0587bb0877
commit
390bf97c99
2 changed files with 4 additions and 166 deletions
|
@ -17,6 +17,7 @@
|
||||||
typing-extensions,
|
typing-extensions,
|
||||||
|
|
||||||
# tests
|
# tests
|
||||||
|
blockbuster,
|
||||||
freezegun,
|
freezegun,
|
||||||
grandalf,
|
grandalf,
|
||||||
httpx,
|
httpx,
|
||||||
|
@ -32,31 +33,22 @@
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "langchain-core";
|
pname = "langchain-core";
|
||||||
version = "0.3.49";
|
version = "0.3.56";
|
||||||
pyproject = true;
|
pyproject = true;
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "langchain-ai";
|
owner = "langchain-ai";
|
||||||
repo = "langchain";
|
repo = "langchain";
|
||||||
tag = "langchain-core==${version}";
|
tag = "langchain-core==${version}";
|
||||||
hash = "sha256-s1vZ7G6Wzywf3euwX/RdCPkgzxvZTYVG0udGpHTIiQc=";
|
hash = "sha256-gsjYr22Phb71oKN4iVGsi6r1iETDhFHCKKOiwp0SuLU=";
|
||||||
};
|
};
|
||||||
|
|
||||||
sourceRoot = "${src.name}/libs/core";
|
sourceRoot = "${src.name}/libs/core";
|
||||||
|
|
||||||
patches = [
|
|
||||||
# Remove dependency on blockbuster (not available in nixpkgs due to dependency on forbiddenfruit)
|
|
||||||
./rm-blockbuster.patch
|
|
||||||
];
|
|
||||||
|
|
||||||
build-system = [ pdm-backend ];
|
build-system = [ pdm-backend ];
|
||||||
|
|
||||||
pythonRelaxDeps = [ "tenacity" ];
|
pythonRelaxDeps = [ "tenacity" ];
|
||||||
|
|
||||||
pythonRemoveDependencies = [
|
|
||||||
"blockbuster"
|
|
||||||
];
|
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
jsonpatch
|
jsonpatch
|
||||||
langsmith
|
langsmith
|
||||||
|
@ -73,6 +65,7 @@ buildPythonPackage rec {
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
nativeCheckInputs = [
|
nativeCheckInputs = [
|
||||||
|
blockbuster
|
||||||
freezegun
|
freezegun
|
||||||
grandalf
|
grandalf
|
||||||
httpx
|
httpx
|
||||||
|
|
|
@ -1,155 +0,0 @@
|
||||||
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()
|
|
Loading…
Add table
Add a link
Reference in a new issue