@@ -131,7 +131,8 @@ mlflow = ["mlflow>=3.15.2"]
131131nibabel = [" nibabel" ]
132132nni = [
133133 " nni; platform_system == 'Linux' and 'arm' not in platform_machine and 'aarch' not in platform_machine" ,
134- " filelock<3.12.0" # https://github.com/microsoft/nni/issues/5523
134+ " filelock<3.12.0" , # https://github.com/microsoft/nni/issues/5523
135+ " typeguard<3" # https://github.com/microsoft/nni/issues/5457
135136]
136137onnx = [" onnx>=1.13.0" , " onnxruntime; python_version <= '3.10'" , " onnx_graphsurgeon" , " onnxscript" ]
137138openslide = [" openslide-python" , " openslide-bin" ]
@@ -161,9 +162,9 @@ transformers = ["transformers>=5.5.0"] # 5.x needs the transchex BertLayer/Bert
161162zarr = [" zarr" ]
162163# these dependencies are for testing/building only, they aren't needed for regular use so don't appear in "all"
163164testing = [
164- " black>=26.3 .1" ,
165+ " black>=26.5 .1" ,
165166 " coverage>=5.5" ,
166- " isort>=5.1,<6,!=6 .0.0" ,
167+ " isort>9 .0.0" ,
167168 " mccabe" ,
168169 " packaging" ,
169170 " parameterized" ,
@@ -172,9 +173,8 @@ testing = [
172173 " pycodestyle" ,
173174 " pyflakes" ,
174175 " pyrefly>=1.0.0" ,
175- " ruff>=0.14.11,<0.15 " ,
176+ " ruff>=0.16.5 " ,
176177 " tomli" , # used in print_dependencies.py for Python<3.11
177- " typeguard<3" , # https://github.com/microsoft/nni/issues/5457
178178 " types-PyYAML" ,
179179 " types-setuptools"
180180]
@@ -291,39 +291,35 @@ exclude = '''
291291)
292292'''
293293
294- [tool .pycln ]
295- all = true
296- exclude = " monai/bundle/__main__.py"
297-
298294[tool .ruff ]
299295line-length = 120
300296target-version = " py310"
301297
302298[tool .ruff .lint ]
303299select = [
304- " B" , # flake8-bugbear - https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
305- " C90" , # mccabe (complexity) - https://docs.astral.sh/ruff/rules/#mccabe-c90
306- " E" , # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e
307- " F" , # pyflakes - https://docs.astral.sh/ruff/rules/#pyflakes-f
308- " N" , # pep8-naming - https://docs.astral.sh/ruff/rules/#pep8-naming-n
309- " PIE" , # flake8-pie - https://docs.astral.sh/ruff/rules/#flake8-pie-pie
310- " TID" , # flake8-tidy-imports - https://docs.astral.sh/ruff/rules/#flake8-tidy-imports-tid
311- " W" , # pycodestyle warnings - https://docs.astral.sh/ruff/rules/#warning-w
312- " NPY" , # NumPy specific rules
313- " UP" , # pyupgrade
314- " RUF100" , # aka yesqa
300+ " B" , # flake8-bugbear - https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
301+ " C90" , # mccabe (complexity) - https://docs.astral.sh/ruff/rules/#mccabe-c90
302+ " E" , # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e
303+ " F" , # pyflakes - https://docs.astral.sh/ruff/rules/#pyflakes-f
304+ " N" , # pep8-naming - https://docs.astral.sh/ruff/rules/#pep8-naming-n
305+ " PIE" , # flake8-pie - https://docs.astral.sh/ruff/rules/#flake8-pie-pie
306+ " TID" , # flake8-tidy-imports - https://docs.astral.sh/ruff/rules/#flake8-tidy-imports-tid
307+ " W" , # pycodestyle warnings - https://docs.astral.sh/ruff/rules/#warning-w
308+ " NPY" , # NumPy specific rules - https://docs.astral.sh/ruff/rules/#numpy-specific-rules-npy
309+ " UP" , # pyupgrade - https://docs.astral.sh/ruff/rules/#pyupgrade-up
310+ " RUF100" , # aka yesqa - https://docs.astral.sh/ruff/rules/unused-noqa/
311+ " F401" , # unused imports - https://docs.astral.sh/ruff/rules/unused-import/
315312]
316313extend-ignore = [
317- " E741" , # ambiguous variable name
318- " F401" , # unused import
314+ " E741" , # ambiguous variable name
319315 " NPY002" , # numpy-legacy-random
320- " E203" , # whitespace before ':' (pycodestyle)
321- " E501" , # line too long (pycodestyle)
322- " C408" , # unnecessary collection call (flake8-comprehensions)
323- " N812" , # lowercase imported as non lowercase (pep8-naming)
324- " B023" , # function uses loop variable (flake8-bugbear)
325- " B905" , # zip() without an explicit strict= parameter (flake8-bugbear)
326- " B028" , # no explicit stacklevel keyword argument found (flake8-bugbear)
316+ " E203" , # whitespace before ':' (pycodestyle)
317+ " E501" , # line too long (pycodestyle)
318+ " C408" , # unnecessary collection call (flake8-comprehensions)
319+ " N812" , # lowercase imported as non lowercase (pep8-naming)
320+ " B023" , # function uses loop variable (flake8-bugbear)
321+ " B905" , # zip() without an explicit strict= parameter (flake8-bugbear)
322+ " B028" , # no explicit stacklevel keyword argument found (flake8-bugbear)
327323]
328324
329325[tool .ruff .lint .per-file-ignores ]
@@ -336,6 +332,8 @@ extend-ignore = [
336332"monai/apps/detection/utils/ATSS_matcher.py" = [
337333 " N999"
338334]
335+ "__init__.py" = [" F401" ] # TODO: change importation in __init__.py files to suit F401
336+ "monai/bundle/__main__.py" = [" F401" ]
339337
340338[tool .ruff .lint .mccabe ]
341339max-complexity = 50 # todo lower this treshold when yesqa id replaced with Ruff's RUF100
0 commit comments