Skip to content

Commit a21115e

Browse files
committed
Separate botocore langchain and botocorelatest
1 parent dc36a86 commit a21115e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

tests/external_botocore/test_bedrock_chat_completion_via_langchain.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,12 @@ def response_streaming(request):
6262

6363
@pytest.fixture(scope="module")
6464
def exercise_model(bedrock_server, model_id, response_streaming):
65-
# These are only available in botocore latest environment.
66-
from langchain.chains import ConversationChain
67-
from langchain_community.chat_models import BedrockChat
65+
try:
66+
# These are only available in certain botocore environments.
67+
from langchain.chains import ConversationChain
68+
from langchain_community.chat_models import BedrockChat
69+
except ImportError:
70+
pytest.skip(reason="Langchain not installed.")
6871

6972
def _exercise_model(prompt):
7073
bedrock_llm = BedrockChat(

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ envlist =
103103
python-cross_agent-pypy27-without_extensions,
104104
python-datastore_sqlite-{py27,py37,py38,py39,py310,py311,py312,pypy27,pypy310},
105105
python-external_botocore-{py38,py39,py310,py311,py312}-botocorelatest,
106+
python-external_botocore-{py311}-botocorelatest-langchain,
106107
python-external_botocore-py310-botocore0125,
107108
python-external_botocore-py311-botocore128,
108109
python-external_feedparser-py27-feedparser{05,06},
@@ -259,7 +260,7 @@ deps =
259260
datastore_redis-redis0400: redis<4.1
260261
external_botocore-botocorelatest: botocore
261262
external_botocore-botocorelatest: boto3
262-
external_botocore-botocorelatest: langchain
263+
external_botocore-botocorelatest-langchain: langchain
263264
external_botocore-botocore128: botocore<1.29
264265
external_botocore-botocore0125: botocore<1.26
265266
external_botocore-{py38,py39,py310,py311,py312}: moto

0 commit comments

Comments
 (0)