Closed purva-thakre closed 1 month ago
The .mypy_cache/
, which is the one containing those json files, is created by mypy with a .gitignore
file in it, which prevents those files showing up in git. Most likely this doesn't happen in your environment.
Closing as it's not an issue with Mitiq, but share more abour environment (OS, python version, mypy version, ..) and we'll try to debug.
Closing as it's not an issue with Mitiq
@cosenal I created this issue because I think we have to add .mypy_cache/
to the gitignore file.
https://github.com/unitaryfund/mitiq/blob/1a3705c43b47ec44eae90849d2de5106ee3a26d9/.gitignore#L1
Information about my local environment:
Mitiq Version: 0.40.0dev
Core Dependencies
-----------------
Cirq Version: 1.4.0
NumPy Version: 1.26.4
SciPy Version: 1.14.1
Optional Dependencies
---------------------
PyQuil Version: 3.5.4
Qiskit Version: Not installed
Braket Version: 1.69.1
Python Version: 3.12.4
Platform Info: Linux (x86_64)
Additional Python Environment Details (from pip freeze
):
Closing as it's not an issue with Mitiq
@cosenal I created this issue because I think we have to add
.mypy_cache/
to the gitignore file.https://github.com/unitaryfund/mitiq/blob/1a3705c43b47ec44eae90849d2de5106ee3a26d9/.gitignore#L1
There is no need for an explicit rule in the main .gitignore
, since the .mypy_cache folder already includes its own .gitignore
file by defailt, which is automatically generated by the MyPy tool.
On other other hand, if you want to add the rule explicitly in the main .gitignore, it won't hurt.
since the .mypy_cache folder already includes its own .gitignore file by default
I think I'm blind because I can't find this .gitignore
file in #2501
Do you see this file generated locally? Maybe something is wrong with my local environment.
On other other hand, if you want to add the rule explicitly in the main .gitignore, it won't hurt.
Yes, I think this might be a better option. I see the repo for mypy
does include mypy_cache/
in the main .gitignore
file.
https://github.com/python/mypy/blob/0c1036717578b00e35625cc353a538e4eb63bc37/.gitignore#L14
I think I'm blind because I can't find this .gitignore file in https://github.com/unitaryfund/mitiq/pull/2501
Well, that's the problem. For some reasons, which I don't know, in your specific environment, that file is not generated. If it were, you wouldn't see any cache file at all in your git diff. As I said in my previous comment, feel free to add a rule to the main .gitignore.
Well, that's the problem. For some reasons, which I don't know, in your specific environment, that file is not generated.
I think this might be a mypy bug on linux. I found a similar issue for windows in the project repo.
@purva-thakre have you tried deleting the .mypy_cache
directory and then re-running mypy
? Any change?
have you tried deleting the .mypy_cache directory and then re-running mypy
Yup, that's the very first thing I tried.
There has been some change to the configuration settings of
mypy
. Whenevermake check-types
is run, json files are gradually added.My local dev environment might also be causing this. 🤷🏾♀️