forked from openvinotoolkit/anomalib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
269 lines (233 loc) · 7.62 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# SETUP CONFIGURATION. #
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "anomalib"
dynamic = ["version"]
readme = "README.md"
description = "anomalib - Anomaly Detection Library"
requires-python = ">=3.10"
license = { file = "LICENSE" }
authors = [{ name = "Intel OpenVINO" }]
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# REQUIREMENTS #
dependencies = [
"omegaconf>=2.1.1",
"rich>=13.5.2",
"jsonargparse[all]>=4.27.7",
"docstring_parser", # CLI help-formatter
"rich_argparse", # CLI help-formatter
]
[project.optional-dependencies]
core = [
"av>=10.0.0",
"einops>=0.3.2",
"freia>=0.2",
"imgaug==0.4.0",
"kornia>=0.6.6",
"matplotlib>=3.4.3",
"opencv-python>=4.5.3.56",
"pandas>=1.1.0",
"timm>=0.5.4,<=0.9.16",
"lightning>=2.2",
"torch>=2",
"torchmetrics>=1.3.2",
"open-clip-torch>=2.23.0",
]
openvino = ["openvino-dev>=2023.0", "nncf>=2.5.0", "onnx>=1.16.0"]
loggers = [
"comet-ml>=3.31.7",
"gradio>=4",
"tensorboard",
"wandb==0.12.17",
]
notebooks = ["gitpython", "ipykernel", "ipywidgets", "notebook"]
docs = [
"myst-parser",
"nbsphinx",
"pandoc",
"sphinx<8.0", # 7.0 breaks readthedocs builds.
"sphinx_autodoc_typehints",
"sphinx_book_theme",
"sphinx-copybutton",
"sphinx_design",
]
test = [
"pre-commit",
"pytest",
"pytest-cov",
"pytest-xdist",
"pytest-mock",
"pytest-sugar",
"coverage[toml]",
"tox",
]
full = ["anomalib[core,openvino,loggers,notebooks]"]
dev = ["anomalib[full,docs,test]"]
[project.scripts]
anomalib = "anomalib.cli.cli:main"
[tool.setuptools.dynamic]
version = { attr = "anomalib.__version__" }
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# RUFF CONFIGURATION #
[tool.ruff]
# Enable rules
select = [
"F", # Pyflakes (`F`)
"E", # pycodestyle error (`E`)
"W", # pycodestyle warning (`W`)
"C90", # mccabe (`C90`)
"I", # isort (`I`)
"N", # pep8-naming (`N`)
"D", # pydocstyle (`D`)
"UP", # pyupgrade (`UP`)
"YTT", # flake8-2020 (`YTT`)
"ANN", # flake8-annotations (`ANN`)
"S", # flake8-bandit (`S`)
"BLE", # flake8-blind-except (`BLE`)
"FBT", # flake8-boolean-trap (`FBT`)
"B", # flake8-bugbear (`B`)
"A", # flake8-builtins (`A`)
"COM", # flake8-commas (`COM`)
"CPY", # flake8-copyright (`CPY`)
"C4", # flake8-comprehensions (`C4`)
"DTZ", # flake8-datatimez (`DTZ`)
"T10", # flake8-debugger (`T10`)
"EM", # flake8-errmsg (`EM`)
"FA", # flake8-future-annotations (`FA`)
"ISC", # flake8-implicit-str-concat (`ISC`)
"ICN", # flake8-import-conventions (`ICN`)
"PIE", # flake8-pie (`PIE`)
"PT", # flake8-pytest-style (`PT`)
"RSE", # flake8-raise (`RSE`)
"RET", # flake8-return (`RET`)
"SLF", # flake8-self (`SLF`)
"SIM", # flake8-simplify (`SIM`)
"TID", # flake8-tidy-imports (`TID`)
"TCH", # flake8-type-checking (`TCH`)
"INT", # flake8-gettext (`INT`)
"ARG", # flake8-unsused-arguments (`ARG`)
"PTH", # flake8-use-pathlib (`PTH`)
"TD", # flake8-todos (`TD`)
"FIX", # flake8-fixme (`FIX`)
"ERA", # eradicate (`ERA`)
"PD", # pandas-vet (`PD`)
"PGH", # pygrep-hooks (`PGH`)
"PL", # pylint (`PL`)
"TRY", # tryceratos (`TRY`)
"FLY", # flynt (`FLY`)
"NPY", # NumPy-specific rules (`NPY`)
"PERF", # Perflint (`PERF`)
"RUF", # Ruff-specific rules (`RUF`)
# "FURB", # refurb (`FURB`) - ERROR: Unknown rule selector: `FURB`
# "LOG", # flake8-logging (`LOG`) - ERROR: Unknown rule selector: `LOG`
]
ignore = [
# pydocstyle
"D107", # Missing docstring in __init__
# pylint
"PLR0913", # Too many arguments to function call
"PLR2004", # consider replacing with a constant variable
"PLR0912", # Too many branches
"PLR0915", # Too many statements
# flake8-annotations
"ANN101", # Missing-type-self
"ANN002", # Missing type annotation for *args
"ANN003", # Missing type annotation for **kwargs
# flake8-bandit (`S`)
"S101", # Use of assert detected.
# flake8-boolean-trap (`FBT`)
"FBT001", # Boolean positional arg in function definition
"FBT002", # Boolean default value in function definition
# flake8-datatimez (`DTZ`)
"DTZ005", # The use of `datetime.datetime.now()` without `tz` argument is not allowed
# flake8-fixme (`FIX`)
"FIX002", # Line contains TODO, consider resolving the issue
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
# Same as Black.
line-length = 120
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Assume Python 3.10.
target-version = "py310"
# Allow imports relative to the "src" and "tests" directories.
src = ["src", "tests"]
[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 15
[tool.ruff.per-file-ignores]
"tests/nightly/tools/benchmarking/test_benchmarking.py" = ["E402"]
[tool.ruff.pydocstyle]
convention = "google"
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# MYPY CONFIGURATION. #
[tool.mypy]
ignore_missing_imports = true
show_error_codes = true
[[tool.mypy.overrides]]
module = ["torch.*", "wandb.*"]
follow_imports = "skip"
follow_imports_for_stubs = true
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# BANDIT CONFIGURATION #
[tool.bandit]
skips = ["B101"]
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# PYTEST CONFIGURATION #
[tool.pytest.ini_options]
addopts = ["--strict-markers", "--strict-config", "--showlocals", "-ra"]
testpaths = "tests"
pythonpath = "src"
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# COVERAGE CONFIGURATION #
[tool.coverage.report]
exclude_lines = [
"except ImportError",
"raise ImportError",
"except ApiException",
"raise ApiException",
"raise ValueError",
]
[tool.coverage.paths]
source = ["src", ".tox/*/site-packages"]
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# NBQA CONFIGURATION #
[tool.nbqa.addopts]
ruff = ["--ignore=E402"]
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# LINK CHECKER CONFIGURATION #
[tool.md_dead_link_check]
exclude_links = [
"https://github.com/openvinotoolkit/anomalib/settings/actions/runners/new",
"https://openvinotoolkit.github.io/anomalib/*", # Remove it after publish documentation
]
exclude_files = ["docs/*"]
force_get_requests_for_links = ["https://secure.ethicspoint.com/*"]