-
Notifications
You must be signed in to change notification settings - Fork 137
Expand file tree
/
Copy pathpyproject.toml
More file actions
132 lines (120 loc) · 2.43 KB
/
Copy pathpyproject.toml
File metadata and controls
132 lines (120 loc) · 2.43 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
[build-system]
requires = ["setuptools>=57", "wheel"]
build-backend = "setuptools.build_meta"
[tool.bandit]
target = ["test", "roboflow"]
tests = ["B201", "B301"]
[tool.ruff]
target-version = "py310"
line-length = 120
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"A",
"ANN",
"ARG",
"B",
"BLE",
"C",
"COM",
"CPY",
"D",
"DTZ",
"EM",
"ERA",
"FBT",
"FIX",
"FLY",
"FURB",
"ISC",
"N",
"PERF",
"PIE",
"PLC0415", # `import` should be at the top-level of a file
"PLR",
"PLW",
"PT",
"PTH",
"RET",
"RUF",
"S",
"SIM",
"SLF",
"T",
"TD",
"TRY",
"UP",
]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"yarn-error.log",
"yarn.lock",
"docs",
"tests/manual/debugme.py", # file is intentionally broken
]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
"E402", # Module level import not at top of file
"F401", # Imported but unused
]
"tests/manual/*.py" = [
"INP001", # Manual scripts don't need __init__.py
]
[tool.ruff.lint.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true
[tool.ruff.lint.flake8-tidy-imports]
banned-module-level-imports = [
"cv2",
"matplotlib",
"numpy",
]
[tool.mypy]
python_version = "3.10"
exclude = ["^build/"]
# numpy's bundled stubs use PEP 695 `type` statements, which mypy rejects when
# checking against python_version 3.10. Skip following them so the type checker
# doesn't choke on numpy's own stub syntax.
[[tool.mypy.overrides]]
module = ["numpy", "numpy.*"]
follow_imports = "skip"
follow_imports_for_stubs = true
[[tool.mypy.overrides]]
module = [
"_datetime.*",
"filetype.*",
# IPython is an optional dependency
"IPython.display.*",
# ipywidgets is an optional dependency
"ipywidgets.*",
"requests_toolbelt.*",
"rfdetr.*",
"torch.*",
"ultralytics.*",
]
ignore_missing_imports = true