forked from sunnypilot/opendbc
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpyproject.toml
More file actions
135 lines (115 loc) · 3.36 KB
/
Copy pathpyproject.toml
File metadata and controls
135 lines (115 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
[project]
name = "opendbc"
version = "0.3.1"
description = "a Python API for your car"
license = "MIT"
authors = [{ name = "Vehicle Researcher", email = "user@comma.ai" }]
readme = "README.md"
requires-python = ">=3.11,<3.13" # pycapnp doesn't work with 3.13
urls = { "homepage" = "https://github.com/commaai/opendbc" }
dependencies = [
"numpy",
"tqdm",
"pycapnp",
"pycryptodome",
]
[project.optional-dependencies]
testing = [
"cffi",
"tree-sitter",
"tree-sitter-c",
"gcovr",
"unittest-parallel",
"zstandard",
# static analysis
"ruff",
"ty",
"lefthook",
"cpplint",
"codespell",
]
examples = [
"inputs",
]
# Dependency groups (PEP 735) are not included in the published wheel.
# Direct URL dependencies must live here because PyPI rejects uploads whose
# `Requires-Dist` contains direct URLs.
[dependency-groups]
testing = [
"comma-car-segments @ https://huggingface.co/datasets/commaai/commaCarSegments/resolve/main/dist/comma_car_segments-0.1.0-py3-none-any.whl",
"cppcheck @ git+https://github.com/commaai/dependencies.git@release-cppcheck#subdirectory=cppcheck",
]
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.codespell]
quiet-level = 3
ignore-words-list = "alo,ba,bu,deque,hda,grey,arange"
builtin = "clear,rare,informal,code,names,en-GB_to_en-US"
check-hidden = true
# https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
[tool.ruff]
line-length = 160
indent-width = 2
target-version="py311"
[tool.ruff.lint]
preview = true
select = [
"E", "F", "W", "PIE", "C4", "ISC", "A", "B",
"NPY", # numpy
"UP", # pyupgrade
"TRY203", "TRY400", "TRY401", # try/excepts
"RUF008", "RUF100",
"TID251",
"PLR1704",
"INP001",
]
ignore = [
"E302", "E305", # too restrictive
"W292",
"E741",
"E402",
"C408",
"ISC003",
"B027",
"B024",
"UP031",
"NPY002", # new numpy random syntax is worse
"C420",
"E111", "E114", "E226", "E241",
"E221", "E265", "E266", "E261",
"E252", "E251", "E231", "E225",
"E262", "C419",
]
flake8-implicit-str-concat.allow-multiline=false
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"numpy.mean".msg = "Sum and divide. np.mean is slow"
[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__)
not-subscriptable = "ignore"
unsupported-operator = "ignore"
# Return types with complex callable signatures
invalid-return-type = "ignore"
# unittest TestSuite iteration (TestCase | TestSuite is always iterable in practice)
not-iterable = "ignore"
# Test class method signature differences
too-many-positional-arguments = "ignore"
[tool.setuptools]
include-package-data = true
[tool.setuptools.package-data]
"opendbc.car" = ["**/*.capnp", "**/*.toml"]
"opendbc.dbc" = ["**/*.dbc"]
"opendbc.safety" = ["*.h", "modes/*.h"]