2024-08-01 16:40:51 -07:00
|
|
|
[project]
|
2023-06-14 07:55:49 -07:00
|
|
|
name = "opendbc"
|
2025-02-10 20:02:55 -06:00
|
|
|
version = "0.2.1"
|
2023-06-18 16:06:42 +01:00
|
|
|
description = "CAN bus databases and tools"
|
2025-12-29 17:14:04 -08:00
|
|
|
license = "MIT"
|
2024-08-01 16:40:51 -07:00
|
|
|
authors = [{ name = "Vehicle Researcher", email = "user@comma.ai" }]
|
2023-06-14 07:55:49 -07:00
|
|
|
readme = "README.md"
|
2025-12-15 15:50:27 -08:00
|
|
|
requires-python = ">=3.11,<3.13" # pycapnp doesn't work with 3.13
|
2024-08-01 16:40:51 -07:00
|
|
|
|
|
|
|
|
urls = { "homepage" = "https://github.com/commaai/opendbc" }
|
2023-06-14 07:55:49 -07:00
|
|
|
|
2024-08-17 12:04:46 -07:00
|
|
|
dependencies = [
|
|
|
|
|
"scons",
|
|
|
|
|
"numpy",
|
2025-12-29 16:25:33 -08:00
|
|
|
"crcmod-plus",
|
2024-08-18 12:08:53 -07:00
|
|
|
"tqdm",
|
2025-09-19 17:17:52 -07:00
|
|
|
"pycapnp==2.1.0",
|
2024-10-04 13:12:17 -07:00
|
|
|
"pycryptodome",
|
2024-08-17 12:04:46 -07:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
[project.optional-dependencies]
|
|
|
|
|
testing = [
|
2026-01-19 14:31:20 -08:00
|
|
|
"comma-car-segments @ https://huggingface.co/datasets/commaai/commaCarSegments/resolve/main/dist/comma_car_segments-0.1.0-py3-none-any.whl",
|
2025-02-19 17:19:31 -08:00
|
|
|
"cffi",
|
2025-03-02 09:11:03 -08:00
|
|
|
"gcovr",
|
2025-11-08 16:51:49 -08:00
|
|
|
# FIXME: pytest 9.0.0 doesn't support unittest.SkipTest
|
|
|
|
|
"pytest==8.4.2",
|
2025-02-19 17:19:31 -08:00
|
|
|
"pytest-coverage",
|
2024-08-17 12:04:46 -07:00
|
|
|
"pytest-mock",
|
2025-02-19 17:19:31 -08:00
|
|
|
"pytest-randomly",
|
2025-07-25 20:32:55 -07:00
|
|
|
# https://github.com/pytest-dev/pytest-xdist/pull/1229
|
2025-07-25 20:44:51 -07:00
|
|
|
"pytest-xdist @ git+https://github.com/sshane/pytest-xdist@2b4372bd62699fb412c4fe2f95bf9f01bd2018da",
|
2024-08-17 12:04:46 -07:00
|
|
|
"pytest-subtests",
|
|
|
|
|
"hypothesis==6.47.*",
|
|
|
|
|
"parameterized>=0.8,<0.9",
|
2026-01-19 14:31:20 -08:00
|
|
|
"zstandard",
|
2025-05-20 12:01:27 -07:00
|
|
|
|
|
|
|
|
# static analysis
|
|
|
|
|
"ruff",
|
|
|
|
|
"ty",
|
|
|
|
|
"lefthook",
|
|
|
|
|
"cpplint",
|
|
|
|
|
"codespell",
|
2024-08-17 12:04:46 -07:00
|
|
|
]
|
|
|
|
|
docs = [
|
|
|
|
|
"Jinja2",
|
|
|
|
|
]
|
2024-08-29 15:12:44 -07:00
|
|
|
examples = [
|
|
|
|
|
"inputs",
|
2024-08-30 13:48:13 -07:00
|
|
|
"matplotlib",
|
2024-08-29 15:12:44 -07:00
|
|
|
]
|
2024-08-17 12:04:46 -07:00
|
|
|
|
2025-02-10 17:02:26 -06:00
|
|
|
[build-system]
|
|
|
|
|
requires = ["setuptools"]
|
|
|
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
|
|
2024-08-16 22:24:44 -07:00
|
|
|
[tool.pytest.ini_options]
|
2025-02-10 18:44:08 -06:00
|
|
|
addopts = "-Werror --strict-config --strict-markers --durations=10 -n auto"
|
2024-08-16 22:24:44 -07:00
|
|
|
python_files = "test_*.py"
|
|
|
|
|
testpaths = [
|
|
|
|
|
"opendbc"
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
[tool.codespell]
|
|
|
|
|
quiet-level = 3
|
2024-10-30 03:11:34 -05:00
|
|
|
ignore-words-list = "alo,ba,bu,deque,hda,grey,arange"
|
2024-08-16 22:24:44 -07:00
|
|
|
builtin = "clear,rare,informal,code,names,en-GB_to_en-US"
|
|
|
|
|
check-hidden = true
|
|
|
|
|
|
2023-08-07 15:26:46 -07:00
|
|
|
# https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
|
|
|
|
|
[tool.ruff]
|
|
|
|
|
line-length = 160
|
2024-08-16 22:24:44 -07:00
|
|
|
indent-width = 2
|
2023-08-14 12:52:47 -07:00
|
|
|
target-version="py311"
|
2024-08-01 23:17:16 -07:00
|
|
|
|
|
|
|
|
[tool.ruff.lint]
|
2025-08-04 15:38:04 -07:00
|
|
|
preview = true
|
2024-08-16 22:24:44 -07:00
|
|
|
select = [
|
|
|
|
|
"E", "F", "W", "PIE", "C4", "ISC", "A", "B",
|
|
|
|
|
"NPY", # numpy
|
|
|
|
|
"UP", # pyupgrade
|
2024-12-15 10:14:30 -08:00
|
|
|
"TRY203", "TRY400", "TRY401", # try/excepts
|
2024-08-16 22:24:44 -07:00
|
|
|
"RUF008", "RUF100",
|
|
|
|
|
"TID251",
|
|
|
|
|
"PLR1704",
|
2024-11-10 20:33:38 -08:00
|
|
|
"INP001",
|
2024-08-16 22:24:44 -07:00
|
|
|
]
|
2024-08-17 00:38:33 -07:00
|
|
|
ignore = [
|
2025-09-27 16:50:05 -07:00
|
|
|
"E302", "E305", # too restrictive
|
2024-08-17 00:38:33 -07:00
|
|
|
"W292",
|
|
|
|
|
"E741",
|
|
|
|
|
"E402",
|
|
|
|
|
"C408",
|
|
|
|
|
"ISC003",
|
|
|
|
|
"B027",
|
|
|
|
|
"B024",
|
2024-12-14 23:35:26 -08:00
|
|
|
"UP031",
|
2024-08-17 00:38:33 -07:00
|
|
|
"NPY002", # new numpy random syntax is worse
|
2025-03-13 20:52:25 -07:00
|
|
|
"C420",
|
2025-08-04 15:38:04 -07:00
|
|
|
"E111", "E114", "E226", "E241",
|
|
|
|
|
"E221", "E265", "E266", "E261",
|
|
|
|
|
"E252", "E251", "E231", "E225",
|
|
|
|
|
"E262", "C419",
|
2024-08-17 00:38:33 -07:00
|
|
|
]
|
2023-08-14 12:52:47 -07:00
|
|
|
flake8-implicit-str-concat.allow-multiline=false
|
2024-08-20 15:45:43 -07:00
|
|
|
|
2024-11-10 20:34:11 -08:00
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
|
|
|
"site_scons/*" = ["ALL"]
|
|
|
|
|
|
2024-08-20 15:45:43 -07:00
|
|
|
[tool.ruff.lint.flake8-tidy-imports.banned-api]
|
|
|
|
|
"pytest.main".msg = "pytest.main requires special handling that is easy to mess up!"
|
2025-08-01 23:33:09 -07:00
|
|
|
"numpy.mean".msg = "Sum and divide. np.mean is slow"
|
2025-02-19 17:19:31 -08:00
|
|
|
# TODO: re-enable when all tests are converted to pytest
|
|
|
|
|
#"unittest".msg = "Use pytest"
|
2025-05-17 18:52:21 -07:00
|
|
|
|
2025-12-28 00:26:14 -08:00
|
|
|
[tool.ty.rules]
|
|
|
|
|
# Ignore rules that produce false positives due to:
|
|
|
|
|
# - Dynamic attributes on LibSafety (loaded from compiled C library)
|
|
|
|
|
# - External dependencies not installed (panda, cereal, openpilot)
|
|
|
|
|
# - capnp dynamically generated types
|
|
|
|
|
possibly-missing-attribute = "ignore"
|
|
|
|
|
unresolved-attribute = "ignore"
|
|
|
|
|
unresolved-import = "ignore"
|
|
|
|
|
|
|
|
|
|
# Intentional LSP violations in subclass method signatures
|
|
|
|
|
invalid-method-override = "ignore"
|
|
|
|
|
|
|
|
|
|
# Optional callables called without None checks in test code
|
|
|
|
|
call-non-callable = "ignore"
|
|
|
|
|
|
|
|
|
|
# Complex type narrowing ty doesn't handle well (isinstance with abstract types)
|
|
|
|
|
invalid-argument-type = "ignore"
|
|
|
|
|
|
|
|
|
|
# Dynamic type patterns (e.g., values converted from Number to list in __init__)
|
2025-12-29 17:24:38 -06:00
|
|
|
not-subscriptable = "ignore"
|
2025-12-28 00:26:14 -08:00
|
|
|
unsupported-operator = "ignore"
|
|
|
|
|
|
|
|
|
|
# Return types with complex callable signatures
|
|
|
|
|
invalid-return-type = "ignore"
|
|
|
|
|
|
|
|
|
|
# Test class method signature differences
|
|
|
|
|
too-many-positional-arguments = "ignore"
|
|
|
|
|
|
2025-05-17 18:52:21 -07:00
|
|
|
[tool.setuptools]
|
|
|
|
|
include-package-data = true
|
|
|
|
|
|
|
|
|
|
[tool.setuptools.package-data]
|
2025-05-17 19:40:10 -07:00
|
|
|
"opendbc.safety" = ["*.h", "board/*.h", "board/drivers/*.h", "modes/*.h"]
|