openpilot icon indicating copy to clipboard operation
openpilot copied to clipboard

Get mypy passing on macOS

Open maxime-desroches opened this issue 1 year ago • 2 comments

currently fails with:

mypy..............................................[✗]
system/loggerd/xattr_cache.py:10: error: Module has no attribute "getxattr"  [attr-defined]
system/loggerd/xattr_cache.py:22: error: Returning Any from function declared to return "None"  [no-any-return]
system/loggerd/xattr_cache.py:22: error: Module has no attribute "setxattr"  [attr-defined]
common/realtime.py:32: error: Module has no attribute "sched_setscheduler"  [attr-defined]
common/realtime.py:37: error: Module has no attribute "sched_setaffinity"  [attr-defined]
system/athena/athenad.py:754: error: Module has no attribute "TCP_USER_TIMEOUT"  [attr-defined]
system/athena/athenad.py:755: error: Module has no attribute "TCP_KEEPIDLE"; maybe "TCP_KEEPALIVE" or "TCP_KEEPINTVL"?  [attr-defined]
Found 7 errors in 3 files (checked 517 source files)

maxime-desroches avatar Aug 08 '24 04:08 maxime-desroches

Looks like an out of date https://github.com/python/typeshed module (https://github.com/python/typeshed/commit/5e2fe131faae347e109b48f451e4b8521378d764)

sshane avatar Aug 08 '24 22:08 sshane

Unfortunately no, TCP_USER_TIMEOUT and TCP_KEEPIDLE are Linux only constants and don't exists on MacOS

maxime-desroches avatar Aug 09 '24 18:08 maxime-desroches

Will take a look. Could you assign the ticket to me? @adeebshihadeh

hellochang avatar Feb 08 '25 22:02 hellochang