Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Pylint unused-import warning suppressions #326

Merged
merged 2 commits into from
Jul 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions datumaro/cli/commands/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: MIT

# pylint: disable=unused-import

from ..contexts.source import build_add_parser as build_parser

__all__ = [
'build_parser',
]
6 changes: 4 additions & 2 deletions datumaro/cli/commands/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: MIT

# pylint: disable=unused-import
from ..contexts.project import build_create_parser as build_parser

from ..contexts.project import build_create_parser as build_parser
__all__ = [
'build_parser',
]
6 changes: 4 additions & 2 deletions datumaro/cli/commands/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: MIT

# pylint: disable=unused-import
from ..contexts.project import build_diff_parser as build_parser

from ..contexts.project import build_diff_parser as build_parser
__all__ = [
'build_parser',
]
6 changes: 4 additions & 2 deletions datumaro/cli/commands/ediff.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: MIT

# pylint: disable=unused-import
from ..contexts.project import build_ediff_parser as build_parser

from ..contexts.project import build_ediff_parser as build_parser
__all__ = [
'build_parser',
]
6 changes: 4 additions & 2 deletions datumaro/cli/commands/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: MIT

# pylint: disable=unused-import
from ..contexts.project import build_export_parser as build_parser

from ..contexts.project import build_export_parser as build_parser
__all__ = [
'build_parser',
]
6 changes: 4 additions & 2 deletions datumaro/cli/commands/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: MIT

# pylint: disable=unused-import
from ..contexts.project import build_filter_parser as build_parser

from ..contexts.project import build_filter_parser as build_parser
__all__ = [
'build_parser',
]
6 changes: 4 additions & 2 deletions datumaro/cli/commands/import_.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: MIT

# pylint: disable=unused-import
from ..contexts.project import build_import_parser as build_parser

from ..contexts.project import build_import_parser as build_parser
__all__ = [
'build_parser',
]
6 changes: 4 additions & 2 deletions datumaro/cli/commands/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: MIT

# pylint: disable=unused-import
from ..contexts.project import build_info_parser as build_parser

from ..contexts.project import build_info_parser as build_parser
__all__ = [
'build_parser',
]
6 changes: 4 additions & 2 deletions datumaro/cli/commands/remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: MIT

# pylint: disable=unused-import
from ..contexts.source import build_remove_parser as build_parser

from ..contexts.source import build_remove_parser as build_parser
__all__ = [
'build_parser',
]
6 changes: 4 additions & 2 deletions datumaro/cli/commands/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: MIT

# pylint: disable=unused-import
from ..contexts.project import build_stats_parser as build_parser

from ..contexts.project import build_stats_parser as build_parser
__all__ = [
'build_parser',
]
6 changes: 4 additions & 2 deletions datumaro/cli/commands/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: MIT

# pylint: disable=unused-import
from ..contexts.project import build_transform_parser as build_parser

from ..contexts.project import build_transform_parser as build_parser
__all__ = [
'build_parser',
]
6 changes: 4 additions & 2 deletions datumaro/cli/commands/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: MIT

# pylint: disable=unused-import

from ..contexts.project import build_validate_parser as build_parser

__all__ = [
'build_parser',
]
8 changes: 5 additions & 3 deletions datumaro/util/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@

# Copyright (C) 2019-2020 Intel Corporation
# Copyright (C) 2019-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

from contextlib import ExitStack
from distutils.util import strtobool as str_to_bool # pylint: disable=unused-import
from functools import partial, wraps
from itertools import islice
from typing import Iterable, Tuple
import attr
import distutils.util

import attr

NOTSET = object()

str_to_bool = distutils.util.strtobool

def find(iterable, pred=lambda x: True, default=None):
return next((x for x in iterable if pred(x)), default)

Expand Down
5 changes: 2 additions & 3 deletions datumaro/util/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
#
# SPDX-License-Identifier: MIT

# pylint: disable=unused-import

from enum import Enum, auto
import importlib
from io import BytesIO
from typing import Any, Callable, Iterator, Iterable, Optional, Tuple, Union
import os
Expand All @@ -18,7 +17,7 @@ class _IMAGE_BACKENDS(Enum):
_IMAGE_BACKEND = None
_image_loading_errors = (FileNotFoundError, )
try:
import cv2
importlib.import_module('cv2')
_IMAGE_BACKEND = _IMAGE_BACKENDS.cv2
except ImportError:
import PIL
zhiltsov-max marked this conversation as resolved.
Show resolved Hide resolved
Expand Down