-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Mypy reports a function is "missing return statement" when unused imports are removed #13667
Comments
mesonbuild/meson#10810 (comment) sounds like there may be some mypy cache issue. This means your bisection results may be confounded, e.g. maybe changing imports just invalidated the cache. Perhaps try bisecting again with |
No luck. The command that run_mypy.py ultimately invokes, with --no-incremental stuck in there:
The issue is still present. Just running that single file, nothing is reported:
Plugging this into git bisect:
Still says that it's all the fault of eli-schwartz/meson@b1676e5 |
I know this sounds ridiculous, but I'm not sure how else to explain it. In the middle of a large refactor of code, which can be found here in its original, mypy-passing state:
https://github.com/mesonbuild/meson/blob/83d18d137dc50437a8263983e8883198c7bc41ed/mesonbuild/compilers/detect.py#L272-L352
I have a function which looks like this:
mypy says this is fine.
detect_static_linker()
doesn't always return, but if it doesn't return, it runs a function that is guaranteed to never return, always raise.This somehow stops working during the course of this series of changes, which doesn't affect the high-level overview of that function: eli-schwartz/meson@83d18d1...6816096
After way too much troubleshooting, and separating out parts of the commit to see what caused it, I produced the above series of commits, and...
... this commit is fingered by git bisect: eli-schwartz/meson@fe42a1c...b1676e5
All it does is finally drop the unused imports rendered redundant by the previous commit. I don't understand how this could be possible.
Furthermore, if I run
mypy mesonbuild/compilers/detect.py
, mypy passes. If I run./run_mypy.py
, a script that contains a list of files to check, and runsmypy "list" "of" "files"
, it triggers the issue.Discussion in the meson review can be seen here, in case that's interesting (two people failed to reproduce it locally at first): mesonbuild/meson#10810 (comment)
Your Environment
mypy.ini
(and other config files): https://github.com/mesonbuild/meson/blob/master/.mypy.iniThe text was updated successfully, but these errors were encountered: