Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare pyright to mypy, and document type checking approach #114

Open
jpmckinney opened this issue Oct 7, 2024 · 0 comments
Open

Compare pyright to mypy, and document type checking approach #114

jpmckinney opened this issue Oct 7, 2024 · 0 comments
Labels
implementation Relating to policy implementation new section

Comments

@jpmckinney
Copy link
Member

jpmckinney commented Oct 7, 2024

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
@jpmckinney jpmckinney added the implementation Relating to policy implementation label Oct 7, 2024
@jpmckinney jpmckinney changed the title Compare pyright to mypy Compare pyright to mypy, and document type checking approach Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implementation Relating to policy implementation new section
Projects
None yet
Development

No branches or pull requests

1 participant