Skip to content

Commit c3b18cc

Browse files
authored
colbert: python 3.12 support (#423)
1 parent fd2db17 commit c3b18cc

File tree

17 files changed

+88
-56
lines changed

17 files changed

+88
-56
lines changed

.github/workflows/ci-unit-tests.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
strategy:
3838
matrix:
3939
python-version:
40-
#- "3.12"
40+
- "3.12"
4141
- "3.11"
4242
- "3.10"
4343
- "3.9"
@@ -51,18 +51,22 @@ jobs:
5151
python-version: "${{ matrix.python-version }}"
5252

5353
- name: Run lint
54+
if: ${{ matrix.python-version != '3.12' }}
5455
uses: ./.github/actions/lint
5556

5657
- name: "Unit tests (root)"
58+
if: ${{ matrix.python-version != '3.12' }}
5759
run: tox -e unit-tests && rm -rf .tox
5860

5961
- name: "Unit tests (colbert)"
6062
run: tox -e unit-tests -c libs/colbert && rm -rf libs/colbert/.tox
6163

6264
- name: "Unit tests (langchain)"
65+
if: ${{ matrix.python-version != '3.12' }}
6366
run: tox -e unit-tests -c libs/langchain && rm -rf libs/langchain/.tox
6467

6568
- name: "Unit tests (llamaindex)"
69+
if: ${{ matrix.python-version != '3.12' }}
6670
run: tox -e unit-tests -c libs/llamaindex && rm -rf libs/llamaindex/.tox
6771

6872
- name: "Unit tests (knowledge-store)"
@@ -72,7 +76,7 @@ jobs:
7276
run: tox -e unit-tests -c libs/knowledge-store && rm -rf libs/knowledge-store/.tox
7377

7478
- name: "Unit tests (knowledge-graph)"
75-
if: ${{ matrix.python-version != '3.9' }}
79+
if: ${{ matrix.python-version != '3.9' && matrix.python-version != '3.10' }}
7680
env:
7781
OPENAI_API_KEY: "${{ secrets.E2E_TESTS_OPEN_AI_KEY }}"
7882
run: tox -e unit-tests -c libs/knowledge-graph && rm -rf libs/knowledge-graph/.tox

libs/colbert/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ documentation = "https://docs.datastax.com/en/ragstack"
1010
packages = [{ include = "ragstack_colbert" }]
1111

1212
[tool.poetry.dependencies]
13-
python = ">=3.9,<3.12"
13+
python = ">=3.9,<3.13"
1414
colbert-ai = "0.2.19"
1515
pyarrow = "14.0.1"
1616
torch = "2.2.1"
@@ -19,8 +19,8 @@ pydantic = "^2.7.1"
1919

2020
[tool.poetry.group.test.dependencies]
2121
ragstack-ai-tests-utils = { path = "../tests-utils", develop = true }
22-
22+
pytest-asyncio = "^0.23.6"
2323

2424
[tool.poetry.group.dev.dependencies]
25-
pytest-asyncio = "^0.23.6"
25+
setuptools = "70.0.0"
2626

libs/e2e-tests/e2e_tests/langchain/trulens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def run_trulens_evaluation(vector_store: VectorStore, llm: BaseLanguageModel):
8484

8585
# Wait for the feedback results to complete
8686
for feedback_future in as_completed(tru_record.feedback_results):
87-
_, feedback_result = feedback_future.result()
87+
feedback_result = feedback_future.result()
8888

8989
feedback_result: FeedbackResult
9090

libs/e2e-tests/pyproject.langchain.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = ""
66
authors = ["DataStax"]
77

88
[tool.poetry.dependencies]
9-
python = ">=3.9,<3.12,!=3.9.7"
9+
python = ">=3.9,<3.13,!=3.9.7"
1010

1111
[tool.poetry.group.test.dependencies]
1212
ragstack-ai-tests-utils = { path = "../tests-utils", develop = true }
@@ -17,7 +17,7 @@ huggingface-hub = "^0.20.3"
1717
azure-storage-blob = "^12.19.0"
1818
pillow = "^10.2.0"
1919
python-dotenv = "^1.0.1"
20-
trulens-eval = "^0.21.0"
20+
trulens-eval = "0.27.2"
2121
nemoguardrails = "^0.8.0"
2222
langchainhub = "^0.1.15"
2323

@@ -54,6 +54,9 @@ llama-index-llms-huggingface = "^0.1.0"
5454

5555
unstructured = "0.14.2"
5656

57+
[tool.poetry.group.dev.dependencies]
58+
setuptools = "^70.0.0"
59+
5760
[build-system]
5861
requires = ["poetry-core"]
5962
build-backend = "poetry.core.masonry.api"

libs/e2e-tests/pyproject.llamaindex.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = ""
66
authors = ["DataStax"]
77

88
[tool.poetry.dependencies]
9-
python = ">=3.9,<3.12,!=3.9.7"
9+
python = ">=3.9,<3.13,!=3.9.7"
1010

1111
[tool.poetry.group.test.dependencies]
1212
ragstack-ai-tests-utils = { path = "../tests-utils", develop = true }
@@ -15,7 +15,7 @@ ruff = "*"
1515
azure-storage-blob = "^12.19.0"
1616
pillow = "^10.2.0"
1717
python-dotenv = "^1.0.1"
18-
trulens-eval = "^0.21.0"
18+
trulens-eval = "0.27.2"
1919
nemoguardrails = "^0.8.0"
2020
langchainhub = "^0.1.15"
2121

@@ -52,6 +52,9 @@ langchain-nvidia-ai-endpoints = "0.0.9"
5252

5353
unstructured = "0.14.2"
5454

55+
[tool.poetry.group.dev.dependencies]
56+
setuptools = "^70.0.0"
57+
5558
[build-system]
5659
requires = ["poetry-core"]
5760
build-backend = "poetry.core.masonry.api"

libs/e2e-tests/pyproject.ragstack-ai.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = ""
66
authors = ["DataStax"]
77

88
[tool.poetry.dependencies]
9-
python = ">=3.9,<3.12,!=3.9.7"
9+
python = ">=3.9,<3.13,!=3.9.7"
1010

1111
[tool.poetry.group.test.dependencies]
1212
ragstack-ai-tests-utils = { path = "../tests-utils", develop = true }
@@ -18,13 +18,16 @@ boto3 = "^1.29.6"
1818
azure-storage-blob = "^12.19.0"
1919
pillow = "^10.2.0"
2020
python-dotenv = "^1.0.1"
21-
trulens-eval = "^0.21.0"
21+
trulens-eval = "0.27.2"
2222
nemoguardrails = "^0.8.0"
2323
langchainhub = "^0.1.15"
2424

2525
# From LangChain optional deps, needed by WebBaseLoader
2626
beautifulsoup4 = "^4"
2727

28+
[tool.poetry.group.dev.dependencies]
29+
setuptools = "^70.0.0"
30+
2831
[build-system]
2932
requires = ["poetry-core"]
3033
build-backend = "poetry.core.masonry.api"

libs/e2e-tests/pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = ""
66
authors = ["DataStax"]
77

88
[tool.poetry.dependencies]
9-
python = ">=3.9,<3.12,!=3.9.7"
9+
python = ">=3.9,<3.13,!=3.9.7"
1010

1111
[tool.poetry.group.test.dependencies]
1212
ragstack-ai-tests-utils = { path = "../tests-utils", develop = true }
@@ -17,7 +17,7 @@ llama-index-llms-huggingface = "^0.1.0"
1717
azure-storage-blob = "^12.19.0"
1818
pillow = "^10.2.0"
1919
python-dotenv = "^1.0.1"
20-
trulens-eval = "^0.21.0"
20+
trulens-eval = "0.27.2"
2121
nemoguardrails = "^0.8.0"
2222
langchainhub = "^0.1.15"
2323

@@ -28,6 +28,9 @@ ragstack-ai-langchain = { path = "../langchain", develop = false, extras = ["col
2828
ragstack-ai-llamaindex = { path = "../llamaindex", develop = false, extras = ["colbert", "google", "azure", "bedrock"] }
2929
ragstack-ai-colbert = { path = "../colbert", develop = false }
3030

31+
[tool.poetry.group.dev.dependencies]
32+
setuptools = "^70.0.0"
33+
3134
[build-system]
3235
requires = ["poetry-core"]
3336
build-backend = "poetry.core.masonry.api"

libs/knowledge-graph/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ include = [
1414

1515

1616
[tool.poetry.dependencies]
17-
python = ">=3.10,<3.12"
17+
python = ">=3.11,<3.13"
1818
langchain = "^0.1.14"
1919
langchain-community = "^0.0.31"
2020
langchain-openai = "^0.1.1"
@@ -36,6 +36,8 @@ pytest = "^8.1.1"
3636
precisely = "^0.1.9"
3737
pytest-asyncio = "^0.23.6"
3838
pytest-dotenv = "^0.5.2"
39+
setuptools = "^70.0.0"
40+
pytest-retry = "^1.6.3"
3941

4042
[build-system]
4143
requires = ["poetry-core"]

libs/knowledge-graph/ragstack_knowledge_graph/schema_inference.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414

1515
class KnowledgeSchemaInferer:
1616
def __init__(self, llm: BaseChatModel) -> None:
17-
prompt = load_template(
18-
"schema_inference.md",
19-
)
2017
prompt = ChatPromptTemplate.from_messages(
2118
[
2219
SystemMessagePromptTemplate(prompt=load_template("schema_inference.md")),

libs/knowledge-graph/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def llm() -> BaseChatModel:
5858
try:
5959
from langchain_openai import ChatOpenAI
6060

61-
model = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0.0)
61+
model = ChatOpenAI(model_name="gpt-4o", temperature=0.0)
6262
return model
6363
except ValueError:
6464
pytest.skip("Unable to create OpenAI model")

0 commit comments

Comments
 (0)