Open benbuckman opened 1 year ago
This started occurring recently after we upgraded from
1.0.0
to1.2.0
.
Would you be able to check to see if it reproduces with the latest version of mypy (1.5.1)? We fix bugs in every release of mypy, and don't backport bugfixes, so there's a good chance this has already been fixed
I am running in the same error. I am on version 1.4.0 (compiled: yes)
. Did you find a solution for this?
Note that a top-level --follow-imports=skip
is usually a mistake and will result in mypy performing only extremely weak type checking. Do not use it unless you really know what you're doing.
That said, if someone here is able to provide a repro, it will increase the odds of this getting fixed.
I just hit this issue as well when I tried to start using the --cache-dir
flag. We are on mypy==1.11.2
, and we are using --follow-imports=normal
(the default). I don't yet have a repro but I'll see if I can make one.
I also just tried doing ln -s /cache_dir .mypy_cache
and it resulted in the same error. Mypy follows the symlink and I can see it storing cache data in the symlinked directory but in the end it still results in a failure.
Notably I am also running multiple mypy invocations in parallel through my build system. It now occurs to me that maybe this is not allowed and errors are expected in this case.
I thought maybe using the sqlite cache would help with parallel access, but I get a similar error there:
Traceback (most recent call last):
[...]
File "mypy/main.py", line 103, in main
File "mypy/main.py", line 187, in run_build
File "mypy/build.py", line 193, in build
File "mypy/build.py", line 268, in _build
File "mypy/build.py", line 2897, in dispatch
File "mypy/build.py", line 3161, in load_graph
File "mypy/build.py", line 1951, in __init__
File "mypy/build.py", line 1277, in find_cache_meta
File "mypy/build.py", line 1144, in _load_json_file
File "mypy/metastore.py", line 192, in read
File "mypy/metastore.py", line 179, in _query
sqlite3.OperationalError: database is locked
Crash Report
There appears to be a caching bug in
mypy 1.2.0 (compiled: yes)
.This started occurring recently after we upgraded from
1.0.0
to1.2.0
.I am running mypy with these parameters:
and very frequently getting the error:
(There is no package in our application called simply
google
; but there are a bunch that start with that name, and have import paths starting withgoogle.
; see below.)If I delete the contents of
.local/mypy_cache
, then the error goes away momentarily, but quickly comes back on the next run.For example:
branch_a
, I run themypy
invocation above, and get that error.rm -rf .local/mypy_cache
mypy
again, it passes without error (Success: no issues found in N source files
).branch_b
, runmypy
again – errors again.branch_a
, errors again, etc.Traceback (file paths user
/Users/*
modified from original)Your Environment
(see
mypy
parameters used above)Given the error about
google
, this is the output ofpip freeze | grep google
:Thank you!