Closed ramirezfranciscof closed 2 years ago
I think this fixes the problems with mypy
that we are having on the aiida repository. If I understood correctly, apparently mypy
now got more opinionated about files/modules naming.
Example of error in aiidateam/aiida-core: see here.
Example of error in this repo: see here.
The name objectstore_db.py
was just to do the test, but if you prefer something else let me know and I'll change it.
@ramirezfranciscof why do you think the renaming of the module fixed the problem? The issue that you link doesn't seem to explain why database.py
should be problematic. They mentioned typing.py
, which makes more sense being a problematic name for mypy
. I don't see why database.py
should cause any problems.
Indeed, I now checked and while the tests now pass, if we upgrade the version of mypy from 0.910-1 to 0.930 or 0.931, I get again an internal error... So I suggest trying to figure out what actually is the problem (and possibly reverting back this PR).
As a note, the error comes from disk_objectstore/db.py:10 that is a line from sqlalchemy; when not using a recent version of SQLAlchemy with mypy, (e.g. 1.4.13) I was just getting some warnings. Using 1.4.22 that is the fixed version in the pre-commit-config.yaml creates the issue
Apparently using sqla 1.4.29 fixes the problem. I'm going to revert this PR soon and change the dependency of sqla in the pre-commit-config.yaml
Codecov Report
100.00% <ø> (ø)
99.39% <100.00%> (ø)
Continue to review full report at Codecov.