2024-05-18 12:43:57 +08:00
|
|
|
[project]
|
|
|
|
name = "openpilot"
|
2024-10-19 05:24:51 +08:00
|
|
|
requires-python = ">= 3.11, <= 3.12"
|
2024-05-18 12:43:57 +08:00
|
|
|
license = {text = "MIT License"}
|
2024-06-28 08:04:05 +08:00
|
|
|
version = "0.1.0"
|
|
|
|
description = "an open source driver assistance system"
|
|
|
|
authors = [
|
|
|
|
{name ="Vehicle Researcher", email="user@comma.ai"}
|
|
|
|
]
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
# multiple users
|
|
|
|
"sounddevice", # micd + soundd
|
|
|
|
"pyserial", # pigeond + qcomgpsd
|
|
|
|
"requests", # many one-off uses
|
|
|
|
"sympy", # rednose + friends
|
|
|
|
"crcmod", # cars + qcomgpsd
|
|
|
|
"tqdm", # cars (fw_versions.py) on start + many one-off uses
|
|
|
|
|
|
|
|
# hardwared
|
|
|
|
"smbus2", # configuring amp
|
|
|
|
|
|
|
|
# core
|
|
|
|
"cffi",
|
|
|
|
"scons",
|
|
|
|
"pycapnp",
|
|
|
|
"Cython",
|
|
|
|
"setuptools",
|
2024-08-06 01:35:58 +08:00
|
|
|
"numpy < 2.0.0",
|
2024-06-28 08:04:05 +08:00
|
|
|
|
|
|
|
# body / webrtcd
|
|
|
|
"aiohttp",
|
|
|
|
"aiortc",
|
|
|
|
"pyaudio",
|
|
|
|
|
|
|
|
# panda
|
|
|
|
"libusb1",
|
|
|
|
"spidev; platform_system == 'Linux'",
|
|
|
|
|
|
|
|
# modeld
|
|
|
|
"onnx >= 1.14.0",
|
|
|
|
"onnxruntime >=1.16.3; platform_system == 'Linux' and platform_machine == 'aarch64'",
|
|
|
|
"onnxruntime-gpu >=1.16.3; platform_system == 'Linux' and platform_machine == 'x86_64'",
|
|
|
|
|
|
|
|
# logging
|
|
|
|
"pyzmq",
|
|
|
|
"sentry-sdk",
|
|
|
|
|
|
|
|
# athena
|
|
|
|
"PyJWT",
|
|
|
|
"json-rpc",
|
|
|
|
"websocket_client",
|
|
|
|
|
|
|
|
# acados deps
|
2024-08-05 07:13:18 +08:00
|
|
|
"casadi >=3.6.6", # 3.12 fixed in 3.6.6
|
2024-06-28 08:04:05 +08:00
|
|
|
"future-fstrings",
|
|
|
|
|
2024-09-10 05:11:07 +08:00
|
|
|
# joystickd
|
|
|
|
"inputs",
|
|
|
|
|
2024-06-28 08:04:05 +08:00
|
|
|
# these should be removed
|
|
|
|
"psutil",
|
|
|
|
"pycryptodome", # used in updated/casync, panda, body, and a test
|
2024-08-06 07:42:22 +08:00
|
|
|
"setproctitle",
|
2024-06-28 08:04:05 +08:00
|
|
|
|
2024-07-26 07:07:59 +08:00
|
|
|
# logreader
|
2024-07-28 17:03:47 +08:00
|
|
|
"zstandard",
|
2024-06-28 08:04:05 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
[project.optional-dependencies]
|
|
|
|
docs = [
|
|
|
|
"Jinja2",
|
2024-07-26 07:07:59 +08:00
|
|
|
"natsort",
|
2024-07-29 06:38:38 +08:00
|
|
|
"mkdocs",
|
2024-06-28 08:04:05 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
testing = [
|
|
|
|
"coverage",
|
|
|
|
"hypothesis ==6.47.*",
|
|
|
|
"mypy",
|
|
|
|
"pytest",
|
|
|
|
"pytest-cov",
|
|
|
|
"pytest-cpp",
|
|
|
|
"pytest-subtests",
|
|
|
|
"pytest-xdist",
|
|
|
|
"pytest-timeout",
|
|
|
|
"pytest-randomly",
|
|
|
|
"pytest-asyncio",
|
|
|
|
"pytest-mock",
|
|
|
|
"pytest-repeat",
|
2024-08-02 13:16:13 +08:00
|
|
|
"ruff",
|
|
|
|
"codespell",
|
2024-08-08 08:23:33 +08:00
|
|
|
"pre-commit-hooks",
|
2024-06-28 08:04:05 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
dev = [
|
|
|
|
"av",
|
|
|
|
"azure-identity",
|
|
|
|
"azure-storage-blob",
|
|
|
|
"dictdiffer",
|
|
|
|
"flaky",
|
|
|
|
"lru-dict",
|
|
|
|
"matplotlib",
|
|
|
|
"parameterized >=0.8, <0.9",
|
2024-07-26 07:07:59 +08:00
|
|
|
#"pprofile",
|
2024-06-28 08:04:05 +08:00
|
|
|
"pyautogui",
|
|
|
|
"pyopencl; platform_machine != 'aarch64'", # broken on arm64
|
2024-07-26 06:13:47 +08:00
|
|
|
"pytools < 2024.1.11; platform_machine != 'aarch64'", # pyopencl use a broken version
|
2024-06-28 08:04:05 +08:00
|
|
|
"pywinctl",
|
|
|
|
"pyprof2calltree",
|
|
|
|
"tabulate",
|
|
|
|
"types-requests",
|
|
|
|
"types-tabulate",
|
|
|
|
|
|
|
|
# this is only pinned since 5.15.11 is broken
|
|
|
|
"pyqt5 ==5.15.2; platform_machine == 'x86_64'", # no aarch64 wheels for macOS/linux
|
|
|
|
]
|
|
|
|
|
2024-09-18 01:03:25 +08:00
|
|
|
tools = [
|
|
|
|
"metadrive-simulator @ https://github.com/commaai/metadrive/releases/download/MetaDrive-minimal/metadrive_simulator-0.4.2.3-py3-none-any.whl ; (platform_machine != 'aarch64')",
|
|
|
|
"rerun-sdk >= 0.18",
|
|
|
|
]
|
|
|
|
|
2024-05-18 12:43:57 +08:00
|
|
|
[project.urls]
|
|
|
|
Homepage = "https://comma.ai"
|
|
|
|
|
2024-06-28 08:04:05 +08:00
|
|
|
[build-system]
|
|
|
|
requires = ["hatchling"]
|
|
|
|
build-backend = "hatchling.build"
|
|
|
|
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
|
|
packages = [ "." ]
|
|
|
|
|
2024-07-20 01:19:38 +08:00
|
|
|
[tool.hatch.metadata]
|
|
|
|
allow-direct-references = true
|
|
|
|
|
2023-08-10 23:23:19 +08:00
|
|
|
[tool.pytest.ini_options]
|
|
|
|
minversion = "6.0"
|
2024-07-10 06:01:16 +08:00
|
|
|
addopts = "--ignore=openpilot/ --ignore=opendbc/ --ignore=panda/ --ignore=rednose_repo/ --ignore=tinygrad_repo/ --ignore=teleoprtc_repo/ --ignore=msgq/ -Werror --strict-config --strict-markers --durations=10 -n auto --dist=loadgroup"
|
2024-06-05 03:09:06 +08:00
|
|
|
cpp_files = "test_*"
|
2023-11-23 05:45:49 +08:00
|
|
|
cpp_harness = "selfdrive/test/cpp_harness.py"
|
2023-08-10 23:23:19 +08:00
|
|
|
python_files = "test_*.py"
|
2024-09-04 06:26:07 +08:00
|
|
|
asyncio_default_fixture_loop_scope = "function"
|
2023-08-29 01:26:19 +08:00
|
|
|
#timeout = "30" # you get this long by default
|
2023-08-30 08:04:42 +08:00
|
|
|
markers = [
|
2023-11-08 09:35:44 +08:00
|
|
|
"slow: tests that take awhile to run and can be skipped with -m 'not slow'",
|
|
|
|
"tici: tests that are only meant to run on the C3/C3X",
|
2023-08-30 08:04:42 +08:00
|
|
|
]
|
2023-09-06 09:52:40 +08:00
|
|
|
testpaths = [
|
2024-06-05 03:09:06 +08:00
|
|
|
"common",
|
2024-10-04 14:39:13 +08:00
|
|
|
"selfdrive",
|
2024-06-05 03:09:06 +08:00
|
|
|
"system/updated",
|
|
|
|
"system/athena",
|
|
|
|
"system/camerad",
|
2024-06-06 06:58:00 +08:00
|
|
|
"system/hardware",
|
2024-06-05 03:09:06 +08:00
|
|
|
"system/loggerd",
|
|
|
|
"system/proclogd",
|
|
|
|
"system/tests",
|
|
|
|
"system/ubloxd",
|
|
|
|
"system/webrtc",
|
|
|
|
"tools/lib/tests",
|
|
|
|
"tools/replay",
|
2024-06-10 08:44:34 +08:00
|
|
|
"tools/cabana",
|
|
|
|
"cereal/messaging/tests",
|
2023-09-06 09:52:40 +08:00
|
|
|
]
|
2023-08-10 23:23:19 +08:00
|
|
|
|
2024-08-02 13:16:13 +08:00
|
|
|
[tool.codespell]
|
|
|
|
quiet-level = 3
|
|
|
|
# if you've got a short variable name that's getting flagged, add it here
|
2024-08-08 07:02:09 +08:00
|
|
|
ignore-words-list = "bu,ro,te,ue,alo,hda,ois,nam,nams,ned,som,parm,setts,inout,warmup,bumb,nd,sie,preints,whit,indexIn,ws,uint,grey,deque,stdio,amin,BA,LITE,atEnd,UIs,errorString,arange,FocusIn,od,tim,relA,hist,copyable,jupyter,thead"
|
2024-08-06 06:25:02 +08:00
|
|
|
builtin = "clear,rare,informal,code,names,en-GB_to_en-US"
|
2024-08-08 08:23:33 +08:00
|
|
|
skip = "./third_party/*, ./tinygrad/*, ./tinygrad_repo/*, ./msgq/*, ./panda/*, ./opendbc/*, ./opendbc_repo/*, ./rednose/*, ./rednose_repo/*, ./teleoprtc/*, ./teleoprtc_repo/*, *.ts, uv.lock, *.onnx, ./cereal/gen/*, */c_generated_code/*"
|
2024-08-02 13:16:13 +08:00
|
|
|
|
2023-08-21 12:08:04 +08:00
|
|
|
[tool.mypy]
|
|
|
|
python_version = "3.11"
|
|
|
|
plugins = [
|
|
|
|
"numpy.typing.mypy_plugin",
|
|
|
|
]
|
|
|
|
exclude = [
|
|
|
|
"cereal/",
|
2024-08-08 08:23:33 +08:00
|
|
|
"msgq/",
|
|
|
|
"msgq_repo/",
|
2023-08-21 12:08:04 +08:00
|
|
|
"opendbc/",
|
2024-08-08 08:23:33 +08:00
|
|
|
"opendbc_repo/",
|
2023-08-21 12:08:04 +08:00
|
|
|
"panda/",
|
|
|
|
"rednose/",
|
|
|
|
"rednose_repo/",
|
|
|
|
"tinygrad/",
|
|
|
|
"tinygrad_repo/",
|
2023-12-02 13:13:37 +08:00
|
|
|
"teleoprtc/",
|
|
|
|
"teleoprtc_repo/",
|
2023-08-21 12:08:04 +08:00
|
|
|
"third_party/",
|
|
|
|
]
|
|
|
|
|
|
|
|
# third-party packages
|
|
|
|
ignore_missing_imports=true
|
|
|
|
|
|
|
|
# helpful warnings
|
|
|
|
warn_redundant_casts=true
|
|
|
|
warn_unreachable=true
|
|
|
|
warn_unused_ignores=true
|
|
|
|
|
|
|
|
# restrict dynamic typing
|
|
|
|
warn_return_any=true
|
|
|
|
|
2024-02-26 05:29:18 +08:00
|
|
|
# allow implicit optionals for default args
|
|
|
|
implicit_optional = true
|
|
|
|
|
2024-08-08 08:23:33 +08:00
|
|
|
local_partial_types=true
|
|
|
|
explicit_package_bases=true
|
|
|
|
disable_error_code = "annotation-unchecked"
|
|
|
|
|
2023-08-10 04:26:54 +08:00
|
|
|
# https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
|
|
|
|
[tool.ruff]
|
2024-03-07 11:15:14 +08:00
|
|
|
indent-width = 2
|
2024-05-21 08:47:48 +08:00
|
|
|
lint.select = [
|
|
|
|
"E", "F", "W", "PIE", "C4", "ISC", "A", "B",
|
|
|
|
"NPY", # numpy
|
|
|
|
"UP", # pyupgrade
|
|
|
|
"TRY302", "TRY400", "TRY401", # try/excepts
|
|
|
|
"RUF008", "RUF100",
|
2024-06-28 05:44:26 +08:00
|
|
|
"TID251",
|
|
|
|
"PLR1704",
|
2024-05-21 08:47:48 +08:00
|
|
|
]
|
2024-05-21 08:40:46 +08:00
|
|
|
lint.ignore = [
|
|
|
|
"E741",
|
|
|
|
"E402",
|
|
|
|
"C408",
|
|
|
|
"ISC003",
|
|
|
|
"B027",
|
|
|
|
"B024",
|
|
|
|
"NPY002", # new numpy random syntax is worse
|
2024-05-21 08:43:54 +08:00
|
|
|
"UP038", # (x, y) -> x|y for isinstance
|
2024-05-21 08:40:46 +08:00
|
|
|
]
|
2023-08-10 04:26:54 +08:00
|
|
|
line-length = 160
|
2024-07-26 05:20:00 +08:00
|
|
|
target-version ="py311"
|
2023-08-10 07:45:09 +08:00
|
|
|
exclude = [
|
2024-03-08 06:58:36 +08:00
|
|
|
"body",
|
|
|
|
"cereal",
|
2023-08-10 07:45:09 +08:00
|
|
|
"panda",
|
|
|
|
"opendbc",
|
|
|
|
"rednose_repo",
|
|
|
|
"tinygrad_repo",
|
2023-12-02 13:13:37 +08:00
|
|
|
"teleoprtc",
|
2023-12-07 07:33:17 +08:00
|
|
|
"teleoprtc_repo",
|
2023-08-10 07:45:09 +08:00
|
|
|
"third_party",
|
2024-09-03 06:45:51 +08:00
|
|
|
"*.ipynb",
|
2023-08-10 07:45:09 +08:00
|
|
|
]
|
2024-07-26 05:20:00 +08:00
|
|
|
lint.flake8-implicit-str-concat.allow-multiline = false
|
|
|
|
|
2024-02-08 14:54:40 +08:00
|
|
|
[tool.ruff.lint.flake8-tidy-imports.banned-api]
|
2023-09-09 01:43:02 +08:00
|
|
|
"selfdrive".msg = "Use openpilot.selfdrive"
|
|
|
|
"common".msg = "Use openpilot.common"
|
|
|
|
"system".msg = "Use openpilot.system"
|
|
|
|
"third_party".msg = "Use openpilot.third_party"
|
2023-09-17 06:11:09 +08:00
|
|
|
"tools".msg = "Use openpilot.tools"
|
2024-02-28 06:17:01 +08:00
|
|
|
"pytest.main".msg = "pytest.main requires special handling that is easy to mess up!"
|
2024-05-18 02:01:44 +08:00
|
|
|
"unittest".msg = "Use pytest"
|
2023-11-11 02:02:05 +08:00
|
|
|
|
|
|
|
[tool.coverage.run]
|
2023-12-10 05:24:18 +08:00
|
|
|
concurrency = ["multiprocessing", "thread"]
|
2024-07-26 05:20:00 +08:00
|
|
|
|
2024-03-07 11:15:14 +08:00
|
|
|
[tool.ruff.format]
|
|
|
|
quote-style = "preserve"
|