forked from onnx/onnx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
119 lines (111 loc) · 3.07 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
[tool.mypy]
follow_imports = "slient"
strict_optional = true
warn_return_any = true
warn_no_return = true
# TODO warn_unused_ignores = true
warn_redundant_casts = true
warn_incomplete_stub = true
# TODO disallow_untyped_calls = true
check_untyped_defs = true
# Allow bare generics like np.ndarray
disallow_any_generics = false
no_implicit_optional = true
# TODO disallow_incomplete_defs = true
# TODO disallow_subclassing_any = true
warn_unused_configs = true
show_error_codes = true
show_column_numbers = true
ignore_missing_imports = true
exclude = [
'\.git',
'__pycache__',
'^build',
'^third_party',
'_pb2.py$',
'\.cache',
'\.eggs',
'\.setuptools-cmake-build',
'venv/',
]
[[tool.mypy.overrides]]
module = ['setup']
ignore_errors = true
[[tool.mypy.overrides]]
module = [
'onnx.onnx_data_pb',
'onnx.onnx_data_pb2',
'onnx.onnx_pb',
'onnx.onnx_pb2',
'onnx.onnx_ml_pb2',
'onnx.onnx_ml_pb2',
'onnx.onnx_operators_pb',
'onnx.onnx_operators_ml_pb2',
]
ignore_errors = true
[tool.black]
# extend-exclude needs to be a regular expression
extend-exclude = "third_party/|venv/"
target-version = ["py37", "py38", "py39", "py310"]
[tool.isort]
profile = "black"
extend_skip_glob = [
"third_party/*",
"*_pb2*",
".setuptools-cmake-build/*",
"venv",
]
[tool.pylint.message_control]
# This list is for vscode. Add new disables in pyproject_pylint.toml for lintrunner and CI.
# Exclude patterns should be modified in .lintrunner.toml
disable = [
"format",
"import-error",
"line-too-long",
"no-name-in-module",
"useless-return",
]
[tool.ruff]
target-version = "py37"
select = [
"E", # pycodestyle
"F", # Pyflakes
"W", # pycodestyle
"B", # flake8-bugbear
"N", # pep8-naming
"YTT", # flake8-2020
"RUF", # Ruff-specific rules
"TID252", # Relative imports
"SIM", # flake8-simplify
]
ignore = [
"E501",
"N803", # Argument casing
"N806", # Relax: Variable name in function should be lowercase
"N999", # Module names
"SIM102", # We don't perfer always combining if branches
"SIM108", # We don't encourage ternary operators
"SIM114", # Don't combine if branches for debugability
"SIM116", # Don't use dict lookup to replace if-else
]
ignore-init-module-imports = true
unfixable = [
"F401", # Unused imports
]
[tool.ruff.flake8-tidy-imports]
# Disallow all relative imports.
ban-relative-imports = "all"
[tool.ruff.per-file-ignores]
"**/*_test*" = ["N802"] # Function casing
"onnx/backend/test/case/**" = ["N802"] # Function casing
"onnx/reference/ops/**" = ["N801"] # Class casing
"onnx/reference/ops/_op_list.py" = ["F401"]
"onnx/__init__.py" = ["F401"]
"onnx/reference/__init__.py" = ["F401"]
"onnx/reference/ops/__init__.py" = ["F401"]
"onnx/reference/ops/aionnxml/_op_list.py" = ["F401"]
"onnx/reference/ops/aionnxml/__init__.py" = ["F401"]
"onnx/reference/ops/aionnx_preview_training/__init__.py" = ["F401"]
"onnx/reference/ops/aionnx_preview_training/_op_list.py" = ["F401"]
"onnx/reference/ops/experimental/__init__.py" = ["F401"]
"onnx/onnx_cpp2py_export/defs.pyi" = ["N802"]