From 67299fcf4c7e2bb2ac4d1c0296c5da760dc3c70b Mon Sep 17 00:00:00 2001 From: Andrew Truong Date: Mon, 4 Nov 2024 10:42:03 -0500 Subject: [PATCH] chore(weave): Add pyright (#2846) --- .pre-commit-config.yaml | 4 ++-- pyproject.toml | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1896e77a4d6..698645f807e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,13 +12,13 @@ repos: - id: ruff-format types_or: [python, pyi, jupyter] - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.10.0' + rev: "v1.10.0" hooks: - id: mypy additional_dependencies: [types-pkg-resources==0.1.3, types-all, wandb>=0.15.5] # Note: You have to update pyproject.toml[tool.mypy] too! - args: ['--config-file=pyproject.toml'] + args: ["--config-file=pyproject.toml"] exclude: (.*pyi$)|(weave_query)|(tests)|(examples) # This is legacy Weave when we were building a notebook product - should be removed - repo: local diff --git a/pyproject.toml b/pyproject.toml index 5484f4d6882..af4437c0c93 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,7 +67,14 @@ llamaindex = ["llama-index>=0.10.35"] mistral0 = ["mistralai>=0.1.8,<1.0.0"] mistral1 = ["mistralai>=1.0.0"] scorers = ["Levenshtein>=0.26.0", "instructor>=1.5.2"] -scorers_tests = ["instructor>=1.5.2", "Levenshtein>=0.26.0", "openai>=1.0.0", "google-generativeai>=0.8.0", "mistralai>=1.0.3", "anthropic>=0.30.0"] +scorers_tests = [ + "instructor>=1.5.2", + "Levenshtein>=0.26.0", + "openai>=1.0.0", + "google-generativeai>=0.8.0", + "mistralai>=1.0.3", + "anthropic>=0.30.0", +] notdiamond = ["notdiamond>=0.3.21", "litellm<=1.49.1"] openai = ["openai>=1.0.0"] pandas-test = ["pandas>=2.2.3"] @@ -176,6 +183,10 @@ line-length = 88 show-fixes = true exclude = ["weave_query"] +[tool.pyright] +include = ["weave"] +exclude = ["weave_query", "tests", "examples", "docs", "noxfile.py"] + [tool.mypy] warn_unused_configs = true # Note: You have to update .pre-commit-config.yaml too!