Skip to content

Look into pyright, compare to mypy, and document type checking approach #114

@jpmckinney

Description

@jpmckinney

pyright seems to be faster, more comprehensive, and less buggy.

We might be able to eliminate some annotations and guards that we added (e.g. to credere-backend) to get mypy to pass.

We might need to keep mypy where plugins are relevant (if used with Django, apparently).

If switching, rename workflows to types.yml

Not sure if there is an advantage to using mypy in combination with mypyc (e.g. if there are shared assumptions of behavior) re: #113


In any case, we should document how to set up whichever tool, e.g.:

[tool.mypy]
strict = true
warn_unreachable = true
exclude = "(build|docs|tests)/"
  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v1.12.0
    hooks:
      - id: mypy
        exclude: "(docs|tests)/"
        additional_dependencies:
          - types-orjson
          - types-pika

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions