-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
"AssertionError: Should never get here in normal mode" when using --follow-imports silent #5377
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
Comments
Follow-up: I can also reproduce using the 'real' requests library, so it's not botocore that's at fault.
run |
I'll go ahead and confirm that |
I cannot reproduce this with the master branch. Can you try that? |
I believe I can. I just cloned mypy ( For what it's worth, I'm testing this with Python 3.6.5 from Anaconda. I have not tried it in 3.7. It does definitely require running I used an absolute path to my mypy bin in my venv to ensure that it was using the master version, as well. |
I still cannot repro this. Do you have anything in Using mypy 0.620, when I run import requests
def returns_int(an_arg) -> requests.Response:
if an_arg == "an arg":
return 3
else:
return 2
def returns_str(something: str) -> str:
return 0 I get these errors:
I then make an edit to test.py, changing |
Honestly, I'm just confused now. I had been really careful last week when I set up my environment and it was consistently reproducible. I haven't really touched anything about my Python setup since last week, either. But I just tried to reproduce it again and can't. The only thing I can imagine is that somehow the mypycache might've been initially generated with an older version of mypy and then the newer version was still crashing with that old cache? But I have tried recreating the cache with 0.620 (my globally installed version) and then running mypy master after the first check, and I still can't reproduce it. Maybe the original cache was created with 0.610? I need version control for my scratch environment. :P I'm closing the ticket. If it ever pops up again I can come back and reopen. I'll be scratching my head over this one for a while, though. |
Hm, the cache is normally invalidated when you use a different mypy version
(the mypy version is actually baked into the cache files and compared).
In any case, I'm glad we can at least agree that it doesn't seem
reproducible with current mypy master.
|
AssertionError on running
mypy test.py --follow-imports silent --disallow-untyped-defs
No AssertionError
.610, Python 3.6.5 from anaconda
Do you see the same issue after installing mypy from Git master?
Haven't tried this.
--follow-imports silent --disallow-untyped-defs
(it doesn't seem to happen if I remove--follow-imports silent
)the full traceback below.
This seems to happen when I make a change to add a new error (e.g. missing type in function def) where there wasn't one before.
This doesn't seem to happen if I'm not importing
botocore.vendored
requests
. But it also does not need to be used in the same function that has the new error.I can work around it by blowing away the
.mypy_cache
directory. But future changes totest.py
just make the error come back again.I think it's likely related to botocore in some way, but obviously the assertion is mypy's fault.
mypy-610-assertion.zip
The text was updated successfully, but these errors were encountered: