From 20a03b3cd45bc5e61c3080aca6d49dfad6369900 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Thu, 13 Jun 2024 21:45:10 -0400 Subject: [PATCH] add mypy --- .pre-commit-config.yaml | 17 +++++++++++++++-- mypy.ini | 4 ++++ pyproject.toml | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 mypy.ini diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa435700..23e91f27 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,19 @@ repos: hooks: # Run the linter. - id: ruff - args: [ --fix ] + args: [--fix] # Run the formatter. - - id: ruff-format \ No newline at end of file + - id: ruff-format + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.9.0 + hooks: + - id: mypy + additional_dependencies: + - pydantic>=2,<3.0.0 + - langchain_core + - langchain_anthropic + - langchain_openai + - langchain_google_genai + files: ^(src/controlflow/llm/models.py)$ + args: [--strict] diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 00000000..6f261433 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,4 @@ +[mypy] +strict=true +follow_imports = skip +files = 'src/controlflow/llm/models.py', 'tests/llm/test_models.py' \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c5976837..dd1ddb70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,6 +57,7 @@ dev = [ "pre-commit", "ruff>=0.3.4", "textual-dev", + "mypy", ] [build-system]