-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathpyproject.toml
More file actions
116 lines (109 loc) · 3.31 KB
/
pyproject.toml
File metadata and controls
116 lines (109 loc) · 3.31 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
[build-system]
requires = [
"wheel",
"setuptools",
"more-itertools>=8.0",
"torch>=2.4.1",
"ninja",
"packaging"
]
[tool.black]
line-length = 120
target-version = ['py39', 'py310', 'py311', 'py312']
include = '\.pyi?$'
exclude = '''
(
/(
# exclude a few common directories in the root of the project
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| venv
| \.pytype
| _build
| buck-out
| build
| dist
)/
# also separately exclude a file named versioneer.py
| monai/_version.py
)
'''
[tool.pycln]
all = true
exclude = "monai/bundle/__main__.py"
[tool.ruff]
line-length = 120
target-version = "py39"
[tool.ruff.lint]
select = [
"B", # flake8-bugbear - https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"C90", # mccabe (complexity) - https://docs.astral.sh/ruff/rules/#mccabe-c90
"E", # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e
"F", # pyflakes - https://docs.astral.sh/ruff/rules/#pyflakes-f
"N", # pep8-naming - https://docs.astral.sh/ruff/rules/#pep8-naming-n
"PIE", # flake8-pie - https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"TID", # flake8-tidy-imports - https://docs.astral.sh/ruff/rules/#flake8-tidy-imports-tid
"W", # pycodestyle warnings - https://docs.astral.sh/ruff/rules/#warning-w
"NPY", # NumPy specific rules
"UP", # pyupgrade
"RUF100", # aka yesqa
]
extend-ignore = [
"E741", # ambiguous variable name
"F401", # unused import
"NPY002", # numpy-legacy-random
"E203", # whitespace before ':' (pycodestyle)
"E501", # line too long (pycodestyle)
"C408", # unnecessary collection call (flake8-comprehensions)
"N812", # lowercase imported as non lowercase (pep8-naming)
"B023", # function uses loop variable (flake8-bugbear)
"B905", # zip() without an explicit strict= parameter (flake8-bugbear)
"B028", # no explicit stacklevel keyword argument found (flake8-bugbear)
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"B018",
"C901",
"N999",
"N801"
]
"monai/apps/detection/utils/ATSS_matcher.py" = [
"N999"
]
[tool.ruff.lint.mccabe]
max-complexity = 50 # todo lower this treshold when yesqa id replaced with Ruff's RUF100
[tool.pytype]
# Space-separated list of files or directories to exclude.
exclude = ["versioneer.py", "_version.py"]
# Space-separated list of files or directories to process.
inputs = ["monai"]
# Keep going past errors to analyze as many files as possible.
keep_going = true
# Run N jobs in parallel.
jobs = 8
# All pytype output goes here.
output = ".pytype"
# Paths to source code directories, separated by ':'.
pythonpath = "."
# Check attribute values against their annotations.
check_attribute_types = true
# Check container mutations against their annotations.
check_container_types = true
# Check parameter defaults and assignments against their annotations.
check_parameter_types = true
# Check variable values against their annotations.
check_variable_types = true
# Comma or space separated list of error names to ignore.
disable = ["pyi-error"]
# Report errors.
report_errors = true
# Experimental: Infer precise return types even for invalid function calls.
precise_return = true
# Experimental: solve unknown types to label with structural types.
protocols = true
# Experimental: Only load submodules that are explicitly imported.
strict_import = false