commaai / openpilot

openpilot is an operating system for robotics. Currently, it upgrades the driver assistance system in 275+ supported cars.
https://comma.ai/openpilot
MIT License
49.21k stars 8.97k forks source link

Get mypy passing on macOS #33230

Open maxime-desroches opened 1 month ago

maxime-desroches commented 1 month ago

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)
sshane commented 1 month ago

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

maxime-desroches commented 1 month ago

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