Skip to content

Commit 5729963

Browse files
authored
chore: stackit - improve type checking + add py.typed (#2031)
1 parent 2f20cca commit 5729963

File tree

4 files changed

+8
-28
lines changed

4 files changed

+8
-28
lines changed

.github/workflows/stackit.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,9 @@ jobs:
4949

5050
- name: Install Hatch
5151
run: pip install --upgrade hatch
52-
53-
# TODO: Once this integration is properly typed, use hatch run test:types
54-
# https://github.com/deepset-ai/haystack-core-integrations/issues/1771
5552
- name: Lint
5653
if: matrix.python-version == '3.9' && runner.os == 'Linux'
57-
run: hatch run fmt-check && hatch run lint:typing
54+
run: hatch run fmt-check && hatch run test:types
5855

5956
- name: Generate docs
6057
if: matrix.python-version == '3.9' && runner.os == 'Linux'

integrations/stackit/pyproject.toml

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,14 @@ unit = 'pytest -m "not integration" {args:tests}'
6565
integration = 'pytest -m "integration" {args:tests}'
6666
all = 'pytest {args:tests}'
6767
cov-retry = 'all --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x'
68-
types = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}"
69-
70-
# TODO: remove lint environment once this integration is properly typed
71-
# test environment should be used instead
72-
# https://github.com/deepset-ai/haystack-core-integrations/issues/1771
73-
[tool.hatch.envs.lint]
74-
installer = "uv"
75-
detached = true
76-
dependencies = ["pip", "mypy>=1.0.0", "ruff>=0.0.243"]
77-
[tool.hatch.envs.lint.scripts]
78-
typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}"
68+
types = """mypy -p haystack_integrations.components.embedders.stackit \
69+
-p haystack_integrations.components.generators.stackit {args}"""
7970

71+
[tool.mypy]
72+
install_types = true
73+
non_interactive = true
74+
check_untyped_defs = true
75+
disallow_incomplete_defs = true
8076

8177
[tool.ruff]
8278
target-version = "py38"
@@ -152,22 +148,9 @@ omit = ["*/tests/*", "*/__init__.py"]
152148
show_missing = true
153149
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
154150

155-
156-
[[tool.mypy.overrides]]
157-
module = [
158-
"stackit.*",
159-
"haystack.*",
160-
"haystack_integrations.*",
161-
"openai.*",
162-
"pytest.*",
163-
"numpy.*",
164-
]
165-
ignore_missing_imports = true
166-
167151
[tool.pytest.ini_options]
168152
addopts = "--strict-markers"
169153
markers = [
170154
"integration: integration tests",
171-
"unit: unit tests",
172155
]
173156
log_cli = true

integrations/stackit/src/haystack_integrations/components/embedders/py.typed

Whitespace-only changes.

integrations/stackit/src/haystack_integrations/components/generators/py.typed

Whitespace-only changes.

0 commit comments

Comments
 (0)