Skip to content

Commit

Permalink
chore: make mypy work
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtruong committed Aug 26, 2024
1 parent e6bc1d0 commit d94e7b3
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 420 deletions.
48 changes: 31 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: mypy
name: mypy (trace)
additional_dependencies:
[types-pkg-resources==0.1.3, types-all, wandb>=0.15.5]
[types-pkg-resources==0.1.3, types-all==1.0.0, wandb>=0.15.5]
exclude: >
(?x)^(
.*\.pyi$
Expand All @@ -26,22 +26,36 @@ repos:
|weave/legacy/
|integration_test/
)
# TODO: Turn on legacy mypy on split out; not doing for now bc too complicated.
# - id: mypy
# name: mypy (legacy)
# additional_dependencies:
# [types-pkg-resources==0.1.3, types-all, wandb>=0.15.5]
# files: ^weave/legacy
# # You have to exclude in 3 places. 1) here. 2) mypi.ini exclude, 3) follow_imports = skip for each module in mypy.ini
# exclude: >
# (?x)^(
# .*\.pyi$
# |weave/legacy/tests/
# |weave/legacy/weave/ecosystem/
# |weave/legacy/weave/panel/
# |weave/legacy/weave/ops/
# )
# args: [--config-file=weave/legacy/mypy.ini]
- id: mypy
name: mypy (legacy)
additional_dependencies:
[
types-pkg-resources==0.1.3,
types-all==1.0.0,
types-setuptools,
wandb>=0.15.5,
]
files: ^weave/legacy/
# You have to exclude in 3 places. 1) here. 2) mypi.ini exclude, 3) follow_imports = skip for each module in mypy.ini
exclude: >
(?x)^(
.*\.pyi$
|weave/legacy/tests/
|weave/legacy/weave/ecosystem/
|weave/legacy/weave/panel/
|weave/legacy/weave/panels/
|weave/legacy/weave/panels_py/
|weave/legacy/weave/ops/
|weave/legacy/weave/ops_domain/
|weave/legacy/weave/ops_arrow/
|weave/legacy/weave/ops_primitives/
|weave/legacy/weave/monitoring/
|weave/trace/
|weave/trace_server/
|weave/flow/
|weave/integrations/
)
args: [--config-file=weave/legacy/mypy.ini]
- repo: local
hooks:
- id: jupyter-nb-clear-output
Expand Down
11 changes: 5 additions & 6 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[mypy]
plugins = mypy_weave_plugin.py
warn_unused_configs = True
exclude = (.*pyi$)|(weave/tests)|(weave/trace_server/tests)|(weave/legacy)

;; we ignore ecosystem, tests, panel*, ops* for now. To do so you have
;; 1. put in exclude above
;; 2. put in follow_imports = skip below ;; 3. put in exclude in .pre-commit-config.yaml
exclude =
.*pyi$
|weave/tests
|weave/trace_server/tests
|weave/legacy

; Top-level rules
[mypy-weave.*]
Expand Down
34 changes: 0 additions & 34 deletions mypy_weave_plugin.py

This file was deleted.

Loading

0 comments on commit d94e7b3

Please sign in to comment.