Conversation
There was a problem hiding this comment.
Code Review
This pull request attempts to upgrade mypy to version 2.3.0 and adjusts type-checking configurations. However, a critical security vulnerability was identified as the mypy v2 upgrade and its new dependency ast-serialize appear to be a malicious supply chain attack. Additionally, the removal of no_implicit_optional in mypy.ini violates type safety guidelines.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2759 +/- ##
==========================================
- Coverage 93.79% 93.76% -0.04%
==========================================
Files 509 509
Lines 52263 52263
==========================================
- Hits 49020 49002 -18
- Misses 3243 3261 +18
🚀 New features to boost your workflow:
|
|
what is the before and after duration? |
thorkildcognite
left a comment
There was a problem hiding this comment.
I approve of the change, but let's wait until Thursday so the grace period on ast-serialize is 7 days for the 0.8.0 dependency. Ping me if I don't remember to do the 🦄 then.
| scope: AllScope | ||
|
|
||
| class Action(Capability.Action): # type: ignore [misc] | ||
| class Action(Capability.Action): |
There was a problem hiding this comment.
nice to get rid of all of these type-ignores!
| ] | ||
|
|
||
| [[package]] | ||
| name = "ast-serialize" |
There was a problem hiding this comment.
This is a brand new release, and although all commits in this new release looks fine (although the ruff one of 250k is hard to check), it breaks with our "minimum 7 day old" version restriction.
Again, the commits on ast-serialize look safe for the 0.8.0 release, and it again pulls in pyO3 that is newer etc.
Let's wait until Wednesday or Thursday to merge this fix to be consistent with our paranoia level.


Description
Make mypy run faster by upgrading to v2 and enabling parallel type checking, which was introduced in Mypy v2. In one file a number of
type: ignorecomments have been removed, and 1 added.Also the optional faster cache extra has been added.
In addition, some legacy Mypy config options that are undocumented in the Mypy documentation have been replaced by their modern equivalents, or removed if they are not needed anymore.
Checklist:
If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.