diff --git a/histomicstk/__init__.py b/histomicstk/__init__.py index 3745ec499..acb8d2073 100644 --- a/histomicstk/__init__.py +++ b/histomicstk/__init__.py @@ -1,15 +1,12 @@ # import sub-packages to support nested calls +from importlib.metadata import PackageNotFoundError +from importlib.metadata import version as _importlib_version + from . import segmentation # must be imported before features from . import utils # must be imported before other packages from . import (annotations_and_masks, features, filters, preprocessing, saliency, workflows) -try: - from importlib.metadata import PackageNotFoundError - from importlib.metadata import version as _importlib_version -except ImportError: - from importlib_metadata import PackageNotFoundError - from importlib_metadata import version as _importlib_version try: __version__ = _importlib_version(__name__) except PackageNotFoundError: diff --git a/histomicstk/cli/__main__.py b/histomicstk/cli/__main__.py index 054666ceb..6e408d8c2 100644 --- a/histomicstk/cli/__main__.py +++ b/histomicstk/cli/__main__.py @@ -1,7 +1,7 @@ import os -from slicer_cli_web import ctk_cli_adjustment # noqa import slicer_cli_web.cli_list_entrypoint # noqa I001 +from slicer_cli_web import ctk_cli_adjustment # noqa def main(): diff --git a/ruff.toml b/ruff.toml index 77589cf23..024a308fb 100644 --- a/ruff.toml +++ b/ruff.toml @@ -4,7 +4,7 @@ exclude = [ "*/web_client/*", "*/*egg*/*", ] -ignore = [ +lint.ignore = [ "B017", "B026", "B904", @@ -34,7 +34,7 @@ ignore = [ "PT017", ] line-length = 100 -select = [ +lint.select = [ "B", # bugbear "C90", # mccabe "D", # pydocstyle @@ -57,8 +57,8 @@ select = [ "RSE", ] -[flake8-quotes] +[lint.flake8-quotes] inline-quotes = "single" -[mccabe] +[lint.mccabe] max-complexity = 14