@@ -130,7 +130,8 @@ mlflow = ["mlflow>=3.15.2"]
130130nibabel = [" nibabel" ]
131131nni = [
132132 " nni; platform_system == 'Linux' and 'arm' not in platform_machine and 'aarch' not in platform_machine" ,
133- " filelock<3.12.0" # https://github.com/microsoft/nni/issues/5523
133+ " filelock<3.12.0" , # https://github.com/microsoft/nni/issues/5523
134+ " typeguard<3" # https://github.com/microsoft/nni/issues/5457
134135]
135136onnx = [" onnx>=1.13.0" , " onnxruntime; python_version <= '3.10'" , " onnx_graphsurgeon" , " onnxscript" ]
136137openslide = [" openslide-python" , " openslide-bin" ]
@@ -159,9 +160,9 @@ transformers = ["transformers>=5.5.0"] # 5.x needs the transchex BertLayer/Bert
159160zarr = [" zarr" ]
160161# these dependencies are for testing/building only, they aren't needed for regular use so don't appear in "all"
161162testing = [
162- " black>=26.3 .1" ,
163+ " black>=26.5 .1" ,
163164 " coverage>=5.5" ,
164- " isort>=5.1,<6,!=6 .0.0" ,
165+ " isort>9 .0.0" ,
165166 " mccabe" ,
166167 " packaging" ,
167168 " parameterized" ,
@@ -170,9 +171,8 @@ testing = [
170171 " pycodestyle" ,
171172 " pyflakes" ,
172173 " pyrefly>=1.0.0" ,
173- " ruff>=0.14.11,<0.15 " ,
174+ " ruff>=0.16.5 " ,
174175 " tomli" , # used in print_dependencies.py for Python<3.11
175- " typeguard<3" , # https://github.com/microsoft/nni/issues/5457
176176 " types-PyYAML" ,
177177 " types-setuptools"
178178]
@@ -289,39 +289,35 @@ exclude = '''
289289)
290290'''
291291
292- [tool .pycln ]
293- all = true
294- exclude = " monai/bundle/__main__.py"
295-
296292[tool .ruff ]
297293line-length = 120
298294target-version = " py310"
299295
300296[tool .ruff .lint ]
301297select = [
302- " B" , # flake8-bugbear - https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
303- " C90" , # mccabe (complexity) - https://docs.astral.sh/ruff/rules/#mccabe-c90
304- " E" , # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e
305- " F" , # pyflakes - https://docs.astral.sh/ruff/rules/#pyflakes-f
306- " N" , # pep8-naming - https://docs.astral.sh/ruff/rules/#pep8-naming-n
307- " PIE" , # flake8-pie - https://docs.astral.sh/ruff/rules/#flake8-pie-pie
308- " TID" , # flake8-tidy-imports - https://docs.astral.sh/ruff/rules/#flake8-tidy-imports-tid
309- " W" , # pycodestyle warnings - https://docs.astral.sh/ruff/rules/#warning-w
310- " NPY" , # NumPy specific rules
311- " UP" , # pyupgrade
312- " RUF100" , # aka yesqa
298+ " B" , # flake8-bugbear - https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
299+ " C90" , # mccabe (complexity) - https://docs.astral.sh/ruff/rules/#mccabe-c90
300+ " E" , # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e
301+ " F" , # pyflakes - https://docs.astral.sh/ruff/rules/#pyflakes-f
302+ " N" , # pep8-naming - https://docs.astral.sh/ruff/rules/#pep8-naming-n
303+ " PIE" , # flake8-pie - https://docs.astral.sh/ruff/rules/#flake8-pie-pie
304+ " TID" , # flake8-tidy-imports - https://docs.astral.sh/ruff/rules/#flake8-tidy-imports-tid
305+ " W" , # pycodestyle warnings - https://docs.astral.sh/ruff/rules/#warning-w
306+ " NPY" , # NumPy specific rules - https://docs.astral.sh/ruff/rules/#numpy-specific-rules-npy
307+ " UP" , # pyupgrade - https://docs.astral.sh/ruff/rules/#pyupgrade-up
308+ " RUF100" , # aka yesqa - https://docs.astral.sh/ruff/rules/unused-noqa/
309+ " F401" , # unused imports - https://docs.astral.sh/ruff/rules/unused-import/
313310]
314311extend-ignore = [
315- " E741" , # ambiguous variable name
316- " F401" , # unused import
312+ " E741" , # ambiguous variable name
317313 " NPY002" , # numpy-legacy-random
318- " E203" , # whitespace before ':' (pycodestyle)
319- " E501" , # line too long (pycodestyle)
320- " C408" , # unnecessary collection call (flake8-comprehensions)
321- " N812" , # lowercase imported as non lowercase (pep8-naming)
322- " B023" , # function uses loop variable (flake8-bugbear)
323- " B905" , # zip() without an explicit strict= parameter (flake8-bugbear)
324- " B028" , # no explicit stacklevel keyword argument found (flake8-bugbear)
314+ " E203" , # whitespace before ':' (pycodestyle)
315+ " E501" , # line too long (pycodestyle)
316+ " C408" , # unnecessary collection call (flake8-comprehensions)
317+ " N812" , # lowercase imported as non lowercase (pep8-naming)
318+ " B023" , # function uses loop variable (flake8-bugbear)
319+ " B905" , # zip() without an explicit strict= parameter (flake8-bugbear)
320+ " B028" , # no explicit stacklevel keyword argument found (flake8-bugbear)
325321]
326322
327323[tool .ruff .lint .per-file-ignores ]
@@ -334,6 +330,8 @@ extend-ignore = [
334330"monai/apps/detection/utils/ATSS_matcher.py" = [
335331 " N999"
336332]
333+ "__init__.py" = [" F401" ] # TODO: change importation in __init__.py files to suit F401
334+ "monai/bundle/__main__.py" = [" F401" ]
337335
338336[tool .ruff .lint .mccabe ]
339337max-complexity = 50 # todo lower this treshold when yesqa id replaced with Ruff's RUF100
0 commit comments