jaraco / skeleton

A generic project skeleton for Python projects.
http://blog.jaraco.com/skeleton/
MIT License
120 stars 38 forks source link

`disable_error_code = import-untyped` in mypy.ini #142

Closed Avasam closed 1 month ago

Avasam commented 1 month ago

@jaraco This is a global solution I suggested to reduce a lot of churn and time-consuming changes left as mentioned in https://github.com/jaraco/skeleton/pull/136#issuecomment-2303511967

Projects that already started doing:

[mypy-*.*]
ignore_missing_imports = True

can keep those entries exactly the way they already are w/o issue.

Projects that have yet to identify their untyped dependencies will see a lot less sudden type errors.

This is directly related to https://github.com/jaraco/skeleton/issues/98#issuecomment-1839814825

jaraco commented 1 month ago

Thanks!

I'm thinking that since some of the projects no longer need this setting, I might merge it to a separate branch and only merge that branch into the projects that are failing. I'm not quite sure how to do that yet.

jaraco commented 1 month ago

I've squash-merged the change to the import-untyped branch. I'm going to see now if I can merge that into some of the failing projects and test the effectiveness.

jaraco commented 1 month ago

Initial indications are that this helps modestly, but also is going to mask the underlying concern. That is, eventually someone is going to have to come along and disable this setting to find out what is still failing. Granted, one could do that in 2-3 years after presumably some of these upstream packages have supplied the types and thus the root issue is solved. But unless the upstream projects are informed of the need, that may never happen.

Given that this issue is likely only a partial fix, I'm almost more inclined to take more drastic measures like disabling mypy checks for the affected projects. It would be nice if there was a way to turn them into warnings instead of errors, so that the test suite could proceed, and the failures would reported but non-blocking.

jaraco commented 1 month ago

As discussed in #143, we're deferring this change and instead disabling mypy for now.