-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
pyproject.toml
111 lines (97 loc) · 2.26 KB
/
pyproject.toml
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
[project]
name = "opendbc"
version = "1.0.0"
description = "CAN bus databases and tools"
license = { file = "LICENSE" }
authors = [{ name = "Vehicle Researcher", email = "[email protected]" }]
readme = "README.md"
requires-python = ">=3.9"
urls = { "homepage" = "https://github.com/commaai/opendbc" }
# setuptools includes distutils which is needed by Cython and pre-commit.
# distutils was removed in python3.12 from the standard library.
dependencies = [
"scons",
"numpy",
"Cython",
"crcmod",
"tqdm",
"pycapnp",
"pandacan@git+https://github.com/commaai/panda.git@master",
"setuptools",
"pycryptodome",
]
[project.optional-dependencies]
testing = [
"ruff",
"pytest",
"pytest-mock",
"pytest-xdist",
"pytest-subtests",
"hypothesis==6.47.*",
"parameterized>=0.8,<0.9",
"pre-commit",
]
docs = [
"Jinja2",
"natsort",
]
examples = [
"inputs",
"matplotlib",
]
[tool.pytest.ini_options]
addopts = "--ignore=panda/ -Werror --strict-config --strict-markers --durations=10 -n auto"
python_files = "test_*.py"
testpaths = [
"opendbc"
]
[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
[tool.cython-lint]
max-line-length = 120
ignore = ["E111", "E114"]
[tool.mypy]
# helpful warnings
warn_redundant_casts=true
warn_unreachable=true
warn_unused_ignores=true
# restrict dynamic typing
warn_return_any=true
# allow implicit optionals for default args
implicit_optional = true
explicit_package_bases=true
# https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
[tool.ruff]
line-length = 160
indent-width = 2
target-version="py311"
[tool.ruff.lint]
select = [
"E", "F", "W", "PIE", "C4", "ISC", "A", "B",
"NPY", # numpy
"UP", # pyupgrade
"TRY302", "TRY400", "TRY401", # try/excepts
"RUF008", "RUF100",
"TID251",
"PLR1704",
"INP001",
]
ignore = [
"W292",
"E741",
"E402",
"C408",
"ISC003",
"B027",
"B024",
"NPY002", # new numpy random syntax is worse
]
flake8-implicit-str-concat.allow-multiline=false
[tool.ruff.lint.per-file-ignores]
"site_scons/*" = ["ALL"]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"pytest.main".msg = "pytest.main requires special handling that is easy to mess up!"
"unittest".msg = "Use pytest"