Skip to content

Commit 8e10a4f

Browse files
authored
Improve mypy config (#622)
1 parent cc8f761 commit 8e10a4f

File tree

14 files changed

+1858
-188
lines changed

14 files changed

+1858
-188
lines changed

libs/colbert/pyproject.toml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,14 @@ pytest-asyncio = "^0.23.6"
3232
asyncio_mode = "auto"
3333

3434
[tool.mypy]
35-
disallow_any_generics = true
36-
disallow_incomplete_defs = true
37-
disallow_untyped_calls = true
38-
disallow_untyped_decorators = true
39-
disallow_untyped_defs = true
35+
strict = true
4036
follow_imports = "normal"
41-
ignore_missing_imports = true
42-
no_implicit_reexport = true
4337
show_error_codes = true
4438
show_error_context = true
45-
strict_equality = true
46-
strict_optional = true
47-
warn_redundant_casts = true
48-
warn_return_any = true
49-
warn_unused_ignores = true
39+
40+
[[tool.mypy.overrides]]
41+
module = "colbert.*,cassandra.cluster.*"
42+
ignore_missing_imports = true
5043

5144
[build-system]
5245
requires = ["poetry-core"]

libs/colbert/tests/unit_tests/baseline_tensors.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import torch
22

33
# fmt: off
4-
# ruff: noqa: E501
54
baseline_tensors = [
65
torch.tensor([-0.0855, 0.0171, -0.0917, 0.0023, 0.0630, 0.0211, 0.0054, 0.1178,
76
0.0086, -0.1145, -0.0220, 0.0094, 0.0973, -0.2913, -0.1577, -0.1720,

libs/knowledge-graph/pyproject.toml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,14 @@ requires = ["poetry-core"]
4343
build-backend = "poetry.core.masonry.api"
4444

4545
[tool.mypy]
46-
disallow_any_generics = true
47-
disallow_incomplete_defs = true
48-
disallow_untyped_calls = true
49-
disallow_untyped_decorators = true
50-
disallow_untyped_defs = true
46+
strict = true
5147
follow_imports = "normal"
52-
ignore_missing_imports = true
53-
no_implicit_reexport = true
5448
show_error_codes = true
5549
show_error_context = true
56-
strict_equality = true
57-
strict_optional = true
58-
warn_redundant_casts = true
59-
warn_return_any = true
60-
warn_unused_ignores = true
50+
51+
[[tool.mypy.overrides]]
52+
module = "testcontainers.*,cassandra.*,graphviz.*"
53+
ignore_missing_imports = true
6154

6255
[tool.pytest.ini_options]
6356
testpaths = ["tests"]
@@ -138,4 +131,4 @@ select = [
138131
"D",
139132
"S101",
140133
"T20",
141-
]
134+
]

libs/knowledge-store/pyproject.toml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,15 @@ requires = ["poetry-core"]
3737
build-backend = "poetry.core.masonry.api"
3838

3939
[tool.mypy]
40-
disallow_any_generics = true
41-
disallow_incomplete_defs = true
42-
disallow_untyped_calls = true
43-
disallow_untyped_decorators = true
44-
disallow_untyped_defs = true
40+
strict = true
4541
follow_imports = "normal"
46-
ignore_missing_imports = true
47-
no_implicit_reexport = true
4842
show_error_codes = true
4943
show_error_context = true
50-
strict_equality = true
51-
strict_optional = true
52-
warn_redundant_casts = true
53-
warn_return_any = true
54-
warn_unused_ignores = true
44+
45+
[[tool.mypy.overrides]]
46+
module = "simsimd.*,cassandra.*"
47+
ignore_missing_imports = true
5548

5649
[tool.pytest.ini_options]
5750
testpaths = ["tests"]
58-
asyncio_mode = "auto"
51+
asyncio_mode = "auto"

libs/langchain/pyproject.toml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,14 @@ pytest-asyncio = "^0.23.6"
4444
mypy = "^1.11.0"
4545

4646
[tool.mypy]
47-
disallow_any_generics = true
48-
disallow_incomplete_defs = true
49-
disallow_untyped_calls = true
50-
disallow_untyped_decorators = true
51-
disallow_untyped_defs = true
47+
strict = true
5248
follow_imports = "normal"
53-
ignore_missing_imports = true
54-
no_implicit_reexport = true
5549
show_error_codes = true
5650
show_error_context = true
57-
strict_equality = true
58-
strict_optional = true
59-
warn_redundant_casts = true
60-
warn_return_any = true
61-
warn_unused_ignores = true
51+
52+
[[tool.mypy.overrides]]
53+
module = "transformers.*,cassandra.*"
54+
ignore_missing_imports = true
6255

6356
[tool.pytest.ini_options]
6457
asyncio_mode = "auto"

libs/llamaindex/pyproject.toml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,15 @@ ragstack-ai-tests-utils = { path = "../tests-utils", develop = true }
5252
ragstack-ai-colbert = { path = "../colbert", develop = true }
5353

5454
[tool.mypy]
55-
disallow_any_generics = true
56-
disallow_incomplete_defs = true
57-
disallow_untyped_calls = true
58-
disallow_untyped_decorators = true
59-
disallow_untyped_defs = true
55+
strict = true
6056
follow_imports = "normal"
61-
ignore_missing_imports = true
62-
no_implicit_reexport = true
6357
show_error_codes = true
6458
show_error_context = true
65-
strict_equality = true
66-
strict_optional = true
67-
warn_redundant_casts = true
68-
warn_return_any = true
69-
warn_unused_ignores = true
59+
60+
[[tool.mypy.overrides]]
61+
# TODO: add py.typed to llama-index packages
62+
module = "llama_index.vector_stores.astra_db.*,llama_index.vector_stores.cassandra.*,cassandra.*"
63+
ignore_missing_imports = true
7064

7165
[build-system]
7266
requires = ["poetry-core"]

libs/ragulate/colbert_chunk_size_and_k.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# ruff: noqa: D103, INP001, T201
21
from __future__ import annotations
32

43
import logging

libs/ragulate/open_ai_chunk_size_and_k.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# ruff: noqa: D103, INP001, T201
21
import os
32
from typing import Any
43

libs/ragulate/poetry.lock

Lines changed: 1799 additions & 93 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/ragulate/pyproject.toml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,19 @@ seaborn = "^0.13.2"
3131
black = "^24.4.2"
3232
isort = "^5.13.2"
3333
langchain-astradb = "0.3.3"
34-
langchain-community = "0.0.38"
35-
langchain-core = "0.1.52"
36-
langchain-openai = "0.1.3"
34+
langchain-community = "^0.2.5"
35+
langchain-core = "^0.2.9"
36+
langchain-openai = "^0.1.3"
3737
pytest = "^8.2.2"
3838
mypy = "^1.11.0"
3939
types-pyyaml = "^6.0.1"
4040
types-aiofiles = "^23.2.0.0"
41+
types-seaborn = "^0.13.2"
42+
types-setuptools = "^70.0.0"
43+
types-tqdm = ">=4.66.0"
44+
pandas-stubs = ">=2.2.2"
45+
ragstack-ai-colbert = "^1.0.5"
46+
ragstack-ai-langchain = "^1.3.0"
4147

4248
[build-system]
4349
requires = ["poetry-core", "wheel"]
@@ -49,18 +55,12 @@ test_unit = "scripts.test_unit_runner:main"
4955
test_integration = "scripts.test_integration_runner:main"
5056

5157
[tool.mypy]
52-
disallow_any_generics = true
53-
disallow_incomplete_defs = true
54-
disallow_untyped_calls = true
55-
disallow_untyped_decorators = true
56-
disallow_untyped_defs = true
58+
strict = true
5759
follow_imports = "normal"
58-
ignore_missing_imports = true
59-
no_implicit_reexport = true
6060
show_error_codes = true
6161
show_error_context = true
62-
strict_equality = true
63-
strict_optional = true
64-
warn_redundant_casts = true
65-
warn_return_any = true
66-
warn_unused_ignores = true
62+
63+
[[tool.mypy.overrides]]
64+
# TODO: remove ragstack exclusions once packages containing py.typed are published
65+
module = "trulens_eval.*,plotly.*,cerberus.*,transformers.*,ragstack_colbert.*,ragstack_langchain.*"
66+
ignore_missing_imports = true

0 commit comments

Comments
 (0)