diff --git a/.github/workflows/stackit.yml b/.github/workflows/stackit.yml index d62f998c4d..0e6f21df1d 100644 --- a/.github/workflows/stackit.yml +++ b/.github/workflows/stackit.yml @@ -49,12 +49,9 @@ jobs: - name: Install Hatch run: pip install --upgrade hatch - - # TODO: Once this integration is properly typed, use hatch run test:types - # https://github.com/deepset-ai/haystack-core-integrations/issues/1771 - name: Lint if: matrix.python-version == '3.9' && runner.os == 'Linux' - run: hatch run fmt-check && hatch run lint:typing + run: hatch run fmt-check && hatch run test:types - name: Generate docs if: matrix.python-version == '3.9' && runner.os == 'Linux' diff --git a/integrations/stackit/pyproject.toml b/integrations/stackit/pyproject.toml index 3fe43b31f2..93c005c602 100644 --- a/integrations/stackit/pyproject.toml +++ b/integrations/stackit/pyproject.toml @@ -65,18 +65,14 @@ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' cov-retry = 'all --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x' -types = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" - -# TODO: remove lint environment once this integration is properly typed -# test environment should be used instead -# https://github.com/deepset-ai/haystack-core-integrations/issues/1771 -[tool.hatch.envs.lint] -installer = "uv" -detached = true -dependencies = ["pip", "mypy>=1.0.0", "ruff>=0.0.243"] -[tool.hatch.envs.lint.scripts] -typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" +types = """mypy -p haystack_integrations.components.embedders.stackit \ +-p haystack_integrations.components.generators.stackit {args}""" +[tool.mypy] +install_types = true +non_interactive = true +check_untyped_defs = true +disallow_incomplete_defs = true [tool.ruff] target-version = "py38" @@ -152,22 +148,9 @@ omit = ["*/tests/*", "*/__init__.py"] show_missing = true exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"] - -[[tool.mypy.overrides]] -module = [ - "stackit.*", - "haystack.*", - "haystack_integrations.*", - "openai.*", - "pytest.*", - "numpy.*", -] -ignore_missing_imports = true - [tool.pytest.ini_options] addopts = "--strict-markers" markers = [ "integration: integration tests", - "unit: unit tests", ] log_cli = true diff --git a/integrations/stackit/src/haystack_integrations/components/embedders/py.typed b/integrations/stackit/src/haystack_integrations/components/embedders/py.typed new file mode 100644 index 0000000000..e69de29bb2 diff --git a/integrations/stackit/src/haystack_integrations/components/generators/py.typed b/integrations/stackit/src/haystack_integrations/components/generators/py.typed new file mode 100644 index 0000000000..e69de29bb2