2024-05-17 21:43:57 -07:00
[ project ]
name = "openpilot"
requires-python = ">= 3.11"
readme = "README.md"
license = { text = "MIT License" }
[ project . urls ]
Homepage = "https://comma.ai"
2023-08-10 08:23:19 -07:00
[ tool . pytest . ini_options ]
minversion = "6.0"
2024-06-04 12:09:06 -07:00
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"
cpp_files = "test_*"
2023-11-22 13:45:49 -08:00
cpp_harness = "selfdrive/test/cpp_harness.py"
2023-08-10 08:23:19 -07:00
python_files = "test_*.py"
2023-08-28 10:26:19 -07:00
#timeout = "30" # you get this long by default
2023-08-29 17:04:42 -07:00
markers = [
2023-11-07 20:35:44 -05: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-29 17:04:42 -07:00
]
2023-09-05 18:52:40 -07:00
testpaths = [
2024-06-04 12:09:06 -07:00
"common" ,
2024-06-04 19:16:55 -07:00
"selfdrive/pandad" ,
2024-06-04 12:09:06 -07:00
"selfdrive/car" ,
"selfdrive/controls" ,
"selfdrive/locationd" ,
"selfdrive/monitoring" ,
"selfdrive/navd/tests" ,
"selfdrive/test/longitudinal_maneuvers" ,
"selfdrive/test/process_replay/test_fuzzy.py" ,
"system/updated" ,
"system/athena" ,
"system/camerad" ,
2024-06-05 15:58:00 -07:00
"system/hardware" ,
2024-06-04 12:09:06 -07:00
"system/loggerd" ,
"system/proclogd" ,
"system/tests" ,
"system/ubloxd" ,
"system/webrtc" ,
"tools/lib/tests" ,
"tools/replay" ,
2024-06-09 17:44:34 -07:00
"tools/cabana" ,
"cereal/messaging/tests" ,
2023-09-05 18:52:40 -07:00
]
2023-08-10 08:23:19 -07:00
2023-08-20 21:08:04 -07:00
[ tool . mypy ]
python_version = "3.11"
plugins = [
"numpy.typing.mypy_plugin" ,
]
exclude = [
"body/" ,
"cereal/" ,
"opendbc/" ,
"panda/" ,
"rednose/" ,
"rednose_repo/" ,
"tinygrad/" ,
"tinygrad_repo/" ,
2023-12-01 21:13:37 -08:00
"teleoprtc/" ,
"teleoprtc_repo/" ,
2023-08-20 21:08:04 -07: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-25 21:29:18 +00:00
# allow implicit optionals for default args
implicit_optional = true
2023-08-20 21:08:04 -07:00
2022-10-21 16:23:56 -07:00
[ tool . poetry ]
name = "openpilot"
version = "0.1.0"
description = "an open source driver assistance system"
authors = [ "Vehicle Researcher <user@comma.ai>" ]
license = "MIT"
readme = "README.md"
repository = "https://github.com/commaai/openpilot"
documentation = "https://docs.comma.ai"
[ tool . poetry . dependencies ]
2024-06-11 13:45:15 -07:00
python = ">=3.11, <3.13"
2024-06-08 16:29:41 -07:00
# multiple users
sounddevice = "*" # micd + soundd
pyserial = "*" # pigeond + qcomgpsd
requests = "*" # many one-off uses
sympy = "*" # rednose + friends
crcmod = "*" # cars + qcomgpsd
# hardwared
smbus2 = "*" # configuring amp
# core
2023-07-24 19:01:09 -07:00
cffi = "*"
2024-06-08 16:29:41 -07:00
scons = "*"
pycapnp = "*"
2023-07-24 19:01:09 -07:00
Cython = "*"
2023-08-17 15:36:14 -07:00
numpy = "*"
2024-06-08 16:29:41 -07:00
# body / webrtcd
aiohttp = "*"
aiortc = "*"
pyaudio = "*"
# panda
libusb1 = "*"
spidev = { version = "*" , platform = "linux" }
# modeld
2023-07-24 19:01:09 -07:00
onnx = ">=1.14.0"
2024-01-16 20:22:05 -08:00
onnxruntime = { version = ">=1.16.3" , platform = "linux" , markers = "platform_machine == 'aarch64'" }
onnxruntime-gpu = { version = ">=1.16.3" , platform = "linux" , markers = "platform_machine == 'x86_64'" }
2024-06-08 16:29:41 -07:00
# logging
2023-07-24 19:01:09 -07:00
pyzmq = "*"
2024-01-26 14:33:59 -08:00
sentry-sdk = "*"
2024-06-08 16:29:41 -07:00
# athena
PyJWT = "*"
json-rpc = "*"
2023-07-24 19:01:09 -07:00
websocket_client = "*"
2022-10-21 16:23:56 -07:00
2024-04-29 16:35:49 -07:00
# acados deps
casadi = "*"
future-fstrings = "*"
2023-12-16 18:52:15 -08:00
# these should be removed
2024-06-08 16:29:41 -07:00
psutil = "*"
timezonefinder = "*" # just used for nav ETA
pycryptodome = "*" # used in updated/casync, panda, body, and a test
2023-12-16 18:52:15 -08:00
2022-10-21 16:23:56 -07:00
[ tool . poetry . group . dev . dependencies ]
2023-07-24 19:01:09 -07:00
av = "*"
2023-08-25 14:01:10 -07:00
azure-identity = "*"
azure-storage-blob = "*"
2023-07-24 19:01:09 -07:00
breathe = "*"
2024-05-18 15:15:41 -07:00
control = "*"
2023-07-24 19:01:09 -07:00
coverage = "*"
dictdiffer = "*"
2024-01-25 17:31:51 -08:00
flaky = "*"
2023-09-21 17:40:14 -07:00
hypothesis = "~6.47"
2023-07-24 19:01:09 -07:00
inputs = "*"
2023-12-16 18:52:15 -08:00
Jinja2 = "*"
2023-07-24 19:01:09 -07:00
lru-dict = "*"
matplotlib = "*"
2024-06-11 13:45:15 -07:00
metadrive-simulator = { git = "https://github.com/commaai/metadrive.git" , branch = "python3.12" , markers = "platform_machine != 'aarch64'" } # no linux/aarch64 wheels for certain dependencies
2023-07-24 19:01:09 -07:00
mpld3 = "*"
mypy = "*"
myst-parser = "*"
natsort = "*"
2023-08-11 20:05:44 -07:00
opencv-python-headless = "*"
2023-07-24 19:01:09 -07:00
parameterized = "^0.8"
2024-06-11 13:45:15 -07:00
#pprofile = "*"
2023-12-17 16:37:33 -08:00
polyline = "*"
2023-07-24 19:01:09 -07:00
pre-commit = "*"
2024-01-24 13:54:31 -08:00
pyautogui = "*"
2024-06-10 19:26:48 -07:00
pyopencl = { version = "*" , markers = "platform_machine != 'aarch64'" } # broken on arm64
2023-07-24 19:01:09 -07:00
pygame = "*"
2024-01-24 13:54:31 -08:00
pywinctl = "*"
2023-07-24 19:01:09 -07:00
pyprof2calltree = "*"
pytest = "*"
2023-08-21 20:51:27 -07:00
pytest-cov = "*"
2023-09-11 14:01:50 -07:00
pytest-cpp = "*"
2023-08-22 14:31:03 -07:00
pytest-subtests = "*"
2023-07-24 19:01:09 -07:00
pytest-xdist = "*"
2023-08-28 10:26:19 -07:00
pytest-timeout = "*"
2023-12-09 14:28:32 -08:00
pytest-randomly = "*"
2024-05-17 11:01:44 -07:00
pytest-asyncio = "*"
pytest-mock = "*"
2024-06-03 17:17:02 -07:00
pytest-repeat = "*"
2024-05-25 11:09:08 -07:00
rerun-sdk = "*"
2023-09-17 15:44:03 -07:00
ruff = "*"
2023-07-24 19:01:09 -07:00
sphinx = "*"
sphinx-rtd-theme = "*"
sphinx-sitemap = "*"
tabulate = "*"
types-requests = "*"
types-tabulate = "*"
2023-12-16 18:52:15 -08:00
tqdm = "*"
2023-10-18 20:18:08 -07:00
# this is only pinned since 5.15.11 is broken
pyqt5 = { version = "==5.15.2" , markers = "platform_machine == 'x86_64'" } # no aarch64 wheels for macOS/linux
2022-10-21 16:23:56 -07:00
[ build-system ]
requires = [ "poetry-core" ]
build-backend = "poetry.core.masonry.api"
2023-08-09 13:26:54 -07:00
# https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
[ tool . ruff ]
2024-03-06 22:15:14 -05:00
indent-width = 2
2024-05-20 17:47:48 -07:00
lint . select = [
"E" , "F" , "W" , "PIE" , "C4" , "ISC" , "A" , "B" ,
"NPY" , # numpy
"UP" , # pyupgrade
"TRY302" , "TRY400" , "TRY401" , # try/excepts
"RUF008" , "RUF100" ,
"TID251"
]
2024-05-20 17:40:46 -07:00
lint . ignore = [
"E741" ,
"E402" ,
"C408" ,
"ISC003" ,
"B027" ,
"B024" ,
"NPY002" , # new numpy random syntax is worse
2024-05-20 17:43:54 -07:00
"UP038" , # (x, y) -> x|y for isinstance
2024-05-20 17:40:46 -07:00
]
2023-08-09 13:26:54 -07:00
line-length = 160
2023-08-09 16:45:09 -07:00
target-version = "py311"
exclude = [
2024-03-07 17:58:36 -05:00
"body" ,
"cereal" ,
2023-08-09 16:45:09 -07:00
"panda" ,
"opendbc" ,
"rednose_repo" ,
"tinygrad_repo" ,
2023-12-01 21:13:37 -08:00
"teleoprtc" ,
2023-12-06 15:33:17 -08:00
"teleoprtc_repo" ,
2023-08-09 16:45:09 -07:00
"third_party" ,
]
2024-02-08 00:54:40 -06:00
lint . flake8-implicit-str-concat . allow-multiline = false
[ tool . ruff . lint . flake8-tidy-imports . banned-api ]
2023-09-08 10:43:02 -07: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-16 15:11:09 -07:00
"tools" . msg = "Use openpilot.tools"
2024-02-27 17:17:01 -05:00
"pytest.main" . msg = "pytest.main requires special handling that is easy to mess up!"
2024-05-17 11:01:44 -07:00
"unittest" . msg = "Use pytest"
2023-11-10 10:02:05 -08:00
[ tool . coverage . run ]
2023-12-09 13:24:18 -08:00
concurrency = [ "multiprocessing" , "thread" ]
2024-03-06 22:15:14 -05:00
[ tool . ruff . format ]
quote-style = "preserve"