hauntsaninja / mypy_primer

Run mypy and pyright over millions of lines of code
MIT License
55 stars 29 forks source link

Add trio to projects list #111

Closed A5rocks closed 7 months ago

A5rocks commented 7 months ago

Trio's an alternative async library that I help maintain!

Here's a couple reasons why this might help mypy primer output:

A5rocks commented 7 months ago

[snip] I think I misinterpreted default mode of mypy primer. Ignore!

erictraut commented 7 months ago

Would it make sense to add this library for pyright as well? Pyright is referenced in the pyproject.toml, so I'm guessing that pyright has been used on this code base.

A5rocks commented 7 months ago

We don't run pyright over the codebase (the perils of type checker compatibility) but we do have "type tests" we run both mypy and pyright over -- would that be a valuable addition?

erictraut commented 7 months ago

I think it would be a valuable addition regardless. Mypy_primer emits deltas, and it's useful to know about any changes to type checking outputs based on changes I make to pyright.

A5rocks commented 7 months ago

I unfortunately don't seem to be able to run mypy_primer w/ pyright locally so I can't check if that works. (Windows has a cryptic error and WSL says npm fails...)

EDIT: fixed (I'll probably PR the fix soon enough) and:

(.venv) PS C:\Users\A5rocks\Documents\mypy_primer> mypy_primer -k trio --type-checker pyright

trio
https://github.com/python-trio/trio
----------

old
> C:\Users\A5rocks\AppData\Local\Temp\mypy_primer\projects\_trio_venv\scripts\activate.bat; C:\Users\A5rocks\AppData\Local\Temp\mypy_primer\old_pyright\pyright\packages\pyright\index.js src/trio/_tests/type_tests (0.1s)
----------

new
> C:\Users\A5rocks\AppData\Local\Temp\mypy_primer\projects\_trio_venv\scripts\activate.bat; C:\Users\A5rocks\AppData\Local\Temp\mypy_primer\new_pyright\pyright\packages\pyright\index.js src/trio/_tests/type_tests (0.1s)
==========

... Hopefully that's fine; I assume pyright would be complaining about our assert_type usage if not!

hauntsaninja commented 7 months ago

Thanks again!