proteneer / timemachine

Differentiate all the things!
Other
138 stars 17 forks source link

Add additional dependencies for mypy in pre-commit #1292

Closed mcwitt closed 3 months ago

mcwitt commented 3 months ago

Currently mypy, when run via pre-commit, treats imports from jax and other libraries as having type Any, resulting in it failing to catch some type errors. This is due to the combination of 1) pre-commit running checks in isolated environments without dependencies installed by default, and 2) the mypy pre-commit hook automatically passing --ignore-missing-imports in the mypy invocation. See this issue comment for more details.

This PR:

  1. Adds the remaining dependencies that export types to additional_dependencies for mypy in the pre-commit configuration
  2. Fixes any newly-exposed type errors

Notes on typing fixes: