pyproject.toml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. [tool.pytest.ini_options]
  2. minversion = "6.0"
  3. addopts = "--ignore=openpilot/ --ignore=cereal/ --ignore=opendbc/ --ignore=panda/ --ignore=rednose_repo/ --ignore=tinygrad_repo/ --ignore=teleoprtc_repo/ -Werror --strict-config --strict-markers --durations=10 -n auto --dist=loadgroup"
  4. cpp_files = "test_*"
  5. cpp_harness = "selfdrive/test/cpp_harness.py"
  6. python_files = "test_*.py"
  7. #timeout = "30" # you get this long by default
  8. markers = [
  9. "slow: tests that take awhile to run and can be skipped with -m 'not slow'",
  10. "tici: tests that are only meant to run on the C3/C3X",
  11. ]
  12. testpaths = [
  13. "common",
  14. "selfdrive/athena",
  15. "selfdrive/boardd",
  16. "selfdrive/car",
  17. "selfdrive/controls",
  18. "selfdrive/locationd",
  19. "selfdrive/monitoring",
  20. "selfdrive/navd/tests",
  21. "selfdrive/thermald",
  22. "selfdrive/test/longitudinal_maneuvers",
  23. "selfdrive/test/process_replay/test_fuzzy.py",
  24. "selfdrive/updated",
  25. "system/camerad",
  26. "system/hardware/tici",
  27. "system/loggerd",
  28. "system/proclogd",
  29. "system/tests",
  30. "system/ubloxd",
  31. "system/webrtc",
  32. "tools/lib/tests",
  33. "tools/replay",
  34. "tools/cabana"
  35. ]
  36. [tool.mypy]
  37. python_version = "3.11"
  38. plugins = [
  39. "numpy.typing.mypy_plugin",
  40. ]
  41. exclude = [
  42. "body/",
  43. "cereal/",
  44. "opendbc/",
  45. "panda/",
  46. "rednose/",
  47. "rednose_repo/",
  48. "tinygrad/",
  49. "tinygrad_repo/",
  50. "teleoprtc/",
  51. "teleoprtc_repo/",
  52. "third_party/",
  53. ]
  54. # third-party packages
  55. ignore_missing_imports=true
  56. # helpful warnings
  57. warn_redundant_casts=true
  58. warn_unreachable=true
  59. warn_unused_ignores=true
  60. # restrict dynamic typing
  61. warn_return_any=true
  62. # allow implicit optionals for default args
  63. implicit_optional = true
  64. [tool.poetry]
  65. name = "openpilot"
  66. version = "0.1.0"
  67. description = "an open source driver assistance system"
  68. authors = ["Vehicle Researcher <user@comma.ai>"]
  69. license = "MIT"
  70. readme = "README.md"
  71. repository = "https://github.com/commaai/openpilot"
  72. documentation = "https://docs.comma.ai"
  73. [tool.poetry.dependencies]
  74. python = "~3.11"
  75. aiohttp = "*"
  76. aiortc = "*"
  77. casadi = "==3.6.3"
  78. cffi = "*"
  79. crcmod = "*"
  80. Cython = "*"
  81. future-fstrings = "*" # for acados
  82. json-rpc = "*"
  83. libusb1 = "*"
  84. numpy = "*"
  85. onnx = ">=1.14.0"
  86. onnxruntime = { version = ">=1.16.3", platform = "linux", markers = "platform_machine == 'aarch64'" }
  87. onnxruntime-gpu = { version = ">=1.16.3", platform = "linux", markers = "platform_machine == 'x86_64'" }
  88. psutil = "*"
  89. pyaudio = "*"
  90. pycapnp = "*"
  91. pycryptodome = "*"
  92. PyJWT = "*"
  93. pyserial = "*"
  94. pyzmq = "*"
  95. requests = "*"
  96. scons = "*"
  97. sentry-sdk = "*"
  98. smbus2 = "*"
  99. sounddevice = "*"
  100. spidev = { version = "*", platform = "linux" }
  101. sympy = "*"
  102. websocket_client = "*"
  103. # these should be removed
  104. markdown-it-py = "*"
  105. timezonefinder = "*"
  106. setproctitle = "*"
  107. [tool.poetry.group.dev.dependencies]
  108. av = "*"
  109. azure-identity = "*"
  110. azure-storage-blob = "*"
  111. breathe = "*"
  112. control = "*"
  113. coverage = "*"
  114. dictdiffer = "*"
  115. ft4222 = "*"
  116. flaky = "*"
  117. hypothesis = "~6.47"
  118. inputs = "*"
  119. Jinja2 = "*"
  120. lru-dict = "*"
  121. matplotlib = "*"
  122. metadrive-simulator = { version = "0.4.2.3", markers = "platform_machine != 'aarch64'" } # no linux/aarch64 wheels for certain dependencies
  123. mpld3 = "*"
  124. mypy = "*"
  125. myst-parser = "*"
  126. natsort = "*"
  127. opencv-python-headless = "*"
  128. parameterized = "^0.8"
  129. pprofile = "*"
  130. polyline = "*"
  131. pre-commit = "*"
  132. pyautogui = "*"
  133. pyopencl = "==2023.1.4" # 2024.1 is broken on arm64
  134. pygame = "*"
  135. pywinctl = "*"
  136. pyprof2calltree = "*"
  137. pytest = "*"
  138. pytest-cov = "*"
  139. pytest-cpp = "*"
  140. pytest-subtests = "*"
  141. pytest-xdist = "*"
  142. pytest-timeout = "*"
  143. pytest-randomly = "*"
  144. ruff = "*"
  145. sphinx = "*"
  146. sphinx-rtd-theme = "*"
  147. sphinx-sitemap = "*"
  148. tabulate = "*"
  149. tenacity = "*"
  150. types-requests = "*"
  151. types-tabulate = "*"
  152. tqdm = "*"
  153. # this is only pinned since 5.15.11 is broken
  154. pyqt5 = { version = "==5.15.2", markers = "platform_machine == 'x86_64'" } # no aarch64 wheels for macOS/linux
  155. [build-system]
  156. requires = ["poetry-core"]
  157. build-backend = "poetry.core.masonry.api"
  158. # https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
  159. [tool.ruff]
  160. indent-width = 2
  161. lint.select = ["E", "F", "W", "PIE", "C4", "ISC", "RUF008", "RUF100", "A", "B", "TID251"]
  162. lint.ignore = ["E741", "E402", "C408", "ISC003", "B027", "B024"]
  163. line-length = 160
  164. target-version="py311"
  165. exclude = [
  166. "body",
  167. "cereal",
  168. "panda",
  169. "opendbc",
  170. "rednose_repo",
  171. "tinygrad_repo",
  172. "teleoprtc",
  173. "teleoprtc_repo",
  174. "third_party",
  175. ]
  176. lint.flake8-implicit-str-concat.allow-multiline=false
  177. [tool.ruff.lint.flake8-tidy-imports.banned-api]
  178. "selfdrive".msg = "Use openpilot.selfdrive"
  179. "common".msg = "Use openpilot.common"
  180. "system".msg = "Use openpilot.system"
  181. "third_party".msg = "Use openpilot.third_party"
  182. "tools".msg = "Use openpilot.tools"
  183. "pytest.main".msg = "pytest.main requires special handling that is easy to mess up!"
  184. [tool.coverage.run]
  185. concurrency = ["multiprocessing", "thread"]
  186. [tool.ruff.format]
  187. quote-style = "preserve"