hauntsaninja / mypy_primer

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

Add jsonschema libs #35

Closed sirosen closed 2 years ago

sirosen commented 2 years ago

I'm adding more info to types-jsonschema stubs, and there were two bugs which it would have been nice to catch earlier. Add two users of types-jsonschema to the project list.

@DMRobertson, I don't believe that adding your project to mypy_primer carries any obligation for you or your team, but wanted to give you a heads-up about this.

We can also cut synapse and just add check-jsonschema if adding it is an issue for someone.

DMRobertson commented 2 years ago

@DMRobertson, I don't believe that adding your project to mypy_primer carries any obligation for you or your team, but wanted to give you a heads-up about this.

We can also cut synapse and just add check-jsonschema if adding it is an issue for someone.

Thanks for the heads-up! No objections from us, but I would like to sound a few notes of caution:

sirosen commented 2 years ago

I think that it's okay that not everything inside the library is annotated, so long as it passes mypy without errors. A bunch of Anys is okay; failing mypy probably isn't (though I don't know for sure).

More importantly, I saw that you're using a bunch of different stubs from typeshed. IMO, that makes the project a sort of attractive option to include, since it covers many different parts of typeshed, even if it only uses each one a little.

This seems to me like the biggest likely issue. I'll wait to hear from maintainers about this, but I probably wouldn't have suggested the integration if I'd known that there's an internal plugin. The internal plugin in particular could make mypy_primer overly sensitive to changes in that project.

Everything else seems pretty much okay to me. I see a commented out block where one project was listed as pulling the types-* packages out of a setup.py, but everything else seems vulnerable to the issue of getting out of date on needed stubs.

JelleZijlstra commented 2 years ago

See #8 for discussion of plugins. But I think it's fine if mypy-primer projects get some mypy errors: what matters is that they give us useful information if something changes.

sirosen commented 2 years ago

I removed synapse since it sounds like it can't be added (yet), so this PR is down to just check-jsonschema for now.

I've started looking for other projects using types-jsonschema, but I'll save any additions for a future change.

hauntsaninja commented 2 years ago

Thanks! I will one day get around to adding support for plugins :-)