You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mypy 0.800 and 0.812 are reporting no-untyped-def and no-untyped-call errors in modules that are configured to have those checks disabled in the mypy.ini file. This may be a regression introduced between 0.790 and 0.800, though this hypothesis is worth double-checking: on one hand, I'm not seeing those errors in 0.790, but on the other, that may also be because the modules in question aren't scanned in 0.790 and are only getting picked up in 0.800 because of the changes in behavior mentioned in 0.800's release log.
Observe that mypy reports hundreds of untyped def / untyped call errors in modules like asv_benchmarks.benchmarks. Furthermore, notice that even though the top-level mypy.ini section enables those checks, they are disabled in the mypy.ini config section referring to asv_benchmarks.benchmarks.
The same issue is present for many other files and modules, for example ones in examples.
Expected Behavior
I expected that mypy would not report errors that the mypy.ini file configured to be ignored in the given module. For example, consider this snippet of the mypy.ini file:
Given this configuration, I expected that mypy would not produce error reports like the following for code in asv_benchmarks.benchmarks:
asv_benchmarks/benchmarks/benchmarks.py:16: error: Function is missing a type annotation [no-untyped-def]
asv_benchmarks/benchmarks/benchmarks.py:19: error: Call to untyped function "enable_numba" of "Numba" in typed context [no-untyped-call]
asv_benchmarks/benchmarks/benchmarks.py:21: error: Call to untyped function "disable_numba" of "Numba" in typed context [no-untyped-call]
asv_benchmarks/benchmarks/benchmarks.py:23: error: Function is missing a type annotation [no-untyped-def]
asv_benchmarks/benchmarks/benchmarks.py:31: error: Function is missing a type annotation [no-untyped-def]
asv_benchmarks/benchmarks/benchmarks.py:34: error: Call to untyped function "enable_numba" of "Numba" in typed context [no-untyped-call]
asv_benchmarks/benchmarks/benchmarks.py:36: error: Call to untyped function "disable_numba" of "Numba" in typed context [no-untyped-call]
Actual Behavior
mypy produced the above errors and many more, across many modules that all had similar disallow_* = False configuration. Since the full mypy error report and mypy.ini file are considerably large (the latter being autogenerated by typing_copilot), I will not paste them here -- they are available at the linked PR referenced above.
Your Environment
Mypy version used: 0.800 and 0.812
Python version used: 3.8.5
Operating system and version: Ubuntu 20.04.2 LTS inside WSL2
Mypy configuration options from mypy.ini (and other config files):
Thanks for taking a look! Unfortunately, I'm not sure I understand what you mean -- are you saying that while mypy finds type errors in asv_benchmarks, it will not consider mypy.ini configuration that is intended to apply to that directory?
I'm not the maintainer of the arviz repo, but don't think asv_benchmarks or the other affected directories are intended to be packages. While type-checking the code there is desirable, there are obviously some errors that I'd like to suppress for now. Is there a way to tell mypy via mypy.ini to ignore those error codes for the affected directories?
Bug Report
Mypy 0.800 and 0.812 are reporting
no-untyped-def
andno-untyped-call
errors in modules that are configured to have those checks disabled in themypy.ini
file. This may be a regression introduced between 0.790 and 0.800, though this hypothesis is worth double-checking: on one hand, I'm not seeing those errors in 0.790, but on the other, that may also be because the modules in question aren't scanned in 0.790 and are only getting picked up in 0.800 because of the changes in behavior mentioned in 0.800's release log.The issue was discovered as part of this PR: arviz-devs/arviz#1528 (comment)
To Reproduce
From the
mypy_regression
branch of my fork ofarviz
: https://github.com/obi1kenobi/arviz/tree/mypy_regressionObserve that
mypy
reports hundreds of untyped def / untyped call errors in modules likeasv_benchmarks.benchmarks
. Furthermore, notice that even though the top-levelmypy.ini
section enables those checks, they are disabled in themypy.ini
config section referring toasv_benchmarks.benchmarks
.The same issue is present for many other files and modules, for example ones in
examples
.Expected Behavior
I expected that
mypy
would not report errors that themypy.ini
file configured to be ignored in the given module. For example, consider this snippet of themypy.ini
file:Given this configuration, I expected that
mypy
would not produce error reports like the following for code inasv_benchmarks.benchmarks
:Actual Behavior
mypy
produced the above errors and many more, across many modules that all had similardisallow_* = False
configuration. Since the fullmypy
error report andmypy.ini
file are considerably large (the latter being autogenerated by typing_copilot), I will not paste them here -- they are available at the linked PR referenced above.Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: