forked from openvinotoolkit/training_extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
133 lines (113 loc) · 3.81 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
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# SETUP CONFIGURATION. #
[build-system]
# FIXME: specified torch wheel to build torch cpp extension should be fixed in some
# different way instead of using static link url
requires = [
"setuptools>=42",
"wheel",
"Cython~=0.29.32",
"numpy~=1.21.0"
]
build-backend = "setuptools.build_meta"
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# CIBUILDWHEEL CONFIGURATION. #
[tool.cibuildwheel]
build = "cp37-manylinux_x86_64 cp38-manylinux_x86_64 cp39-manylinux_x86_64 cp310-manylinux_x86_64"
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# COVERAGE CONFIGURATION. #
[tool.coverage.run]
source = [
"src/otx/",
]
omit = [
"src/otx/algorithms/*/configs/**/*pipeline*.py",
"src/otx/algorithms/*/configs/**/model*.py",
"src/otx/algorithms/*/configs/**/deployment.py",
"src/otx/algorithms/**/configs/**/backbones/*",
"src/otx/algorithms/**/*sample*.py",
"**/__init__.py",
"src/otx/recipes/*",
]
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# MYPY CONFIGURATION. #
[tool.mypy]
python_version = 3.8
ignore_missing_imports = true
show_error_codes = true
# TODO: Need to be edited
follow_imports = "skip"
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# RUFF CONFIGURATION #
[tool.ruff]
# Enable rules
# pydocstyle (`D`)
# pycodestyle error (`E`)
# pycodestyle warning (`W`)
# Pyflakes (`F`)
# isort (`I`)
# pylint (`PL`)
select = ["D", "E", "F", "I", "W", "PL"]
ignore = [
# pydocstyle
"D107", # Missing docstring in __init__
"D202", # No blank lines allowed after function docstring
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D401", # First line should be in imperative mood; try rephrasing
"D404", # First word of the docstring should not be This
"D406", # Section name should end with a newline
"D407", # Missing dashed underline after section
"D413", # Missing blank line after last section
"D418", # Methods decorated with @overload shouldn't contain a docstring
# pylint
"PLW2901" # Redefine loop name
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
unfixable = [
"F401", # disable autofix for unused imports
]
# 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",
]
# Extended exclude for the project specific
extend-exclude = [
"src/otx/api"
]
# Same as Black.
line-length = 120
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# minimum target version
target-version = "py38"
format = "grouped"
[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.ruff.pylint]
allow-magic-value-types = ["str", "bytes", "int", "float"]
max-args = 20
max-branches = 25
max-statements = 120
max-returns = 10