1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

devlib: Remove unused imports

Also import 'warnings' before 'wrapt' module to address a pylint
warning.

Signed-off-by: Metin Kaya <metin.kaya@arm.com>
This commit is contained in:
Metin Kaya 2024-01-17 11:46:02 +00:00 committed by Marc Bonnici
parent 7ccdea6b8e
commit 38d8053f2f
13 changed files with 21 additions and 50 deletions

View File

@ -1,4 +1,4 @@
# Copyright 2019 ARM Limited # Copyright 2024 ARM Limited
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -19,7 +19,6 @@ from datetime import timedelta
from devlib.collector import (CollectorBase, CollectorOutput, from devlib.collector import (CollectorBase, CollectorOutput,
CollectorOutputEntry) CollectorOutputEntry)
from devlib.target import KernelConfigTristate
from devlib.exception import TargetStableError from devlib.exception import TargetStableError
from devlib.utils.misc import memoized from devlib.utils.misc import memoized

View File

@ -1,4 +1,4 @@
# Copyright 2018 ARM Limited # Copyright 2024 ARM Limited
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -14,7 +14,6 @@
# #
import os import os
import shutil
from devlib.collector import (CollectorBase, CollectorOutput, from devlib.collector import (CollectorBase, CollectorOutput,
CollectorOutputEntry) CollectorOutputEntry)

View File

@ -1,4 +1,4 @@
# Copyright 2018 ARM Limited # Copyright 2024 ARM Limited
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -13,8 +13,6 @@
# limitations under the License. # limitations under the License.
# #
import shutil
from tempfile import NamedTemporaryFile
from pexpect.exceptions import TIMEOUT from pexpect.exceptions import TIMEOUT
from devlib.collector import (CollectorBase, CollectorOutput, from devlib.collector import (CollectorBase, CollectorOutput,

View File

@ -1,4 +1,4 @@
# Copyright 2018 ARM Limited # Copyright 2024 ARM Limited
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -16,9 +16,6 @@
import os import os
import subprocess import subprocess
from shutil import copyfile
from tempfile import NamedTemporaryFile
from devlib.collector import (CollectorBase, CollectorOutput, from devlib.collector import (CollectorBase, CollectorOutput,
CollectorOutputEntry) CollectorOutputEntry)
from devlib.exception import TargetStableError, HostError from devlib.exception import TargetStableError, HostError

View File

@ -1,4 +1,4 @@
# Copyright 2019 ARM Limited # Copyright 2024 ARM Limited
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -15,13 +15,9 @@
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from contextlib import contextmanager, nullcontext from contextlib import contextmanager, nullcontext
from datetime import datetime
from functools import partial
from weakref import WeakSet
from shlex import quote from shlex import quote
import os import os
import signal import signal
import socket
import subprocess import subprocess
import threading import threading
import time import time

View File

@ -1,4 +1,4 @@
# Copyright 2015-2017 ARM Limited # Copyright 2015-2024 ARM Limited
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
import glob
import os import os
import signal import signal
import shutil import shutil
@ -23,8 +22,7 @@ from getpass import getpass
from shlex import quote from shlex import quote
from devlib.exception import ( from devlib.exception import (
TargetTransientError, TargetStableError, TargetStableError, TargetTransientCalledProcessError, TargetStableCalledProcessError
TargetTransientCalledProcessError, TargetStableCalledProcessError
) )
from devlib.utils.misc import check_output from devlib.utils.misc import check_output
from devlib.connection import ConnectionBase, PopenBackgroundCommand from devlib.connection import ConnectionBase, PopenBackgroundCommand

View File

@ -1,4 +1,4 @@
# Copyright 2014-2018 ARM Limited # Copyright 2014-2024 ARM Limited
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
from contextlib import contextmanager
from operator import itemgetter
from devlib.module import Module from devlib.module import Module
from devlib.exception import TargetStableError from devlib.exception import TargetStableError

View File

@ -1,4 +1,4 @@
# Copyright 2015-2018 ARM Limited # Copyright 2015-2024 ARM Limited
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
# #
import os import os
import sys
import tempfile import tempfile
import time import time
import pexpect import pexpect

View File

@ -1,4 +1,4 @@
# Copyright 2018 ARM Limited # Copyright 2024 ARM Limited
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -25,7 +25,6 @@ import time
import logging import logging
import posixpath import posixpath
import subprocess import subprocess
import sys
import tarfile import tarfile
import tempfile import tempfile
import threading import threading
@ -35,7 +34,6 @@ import copy
import inspect import inspect
import itertools import itertools
from collections import namedtuple, defaultdict from collections import namedtuple, defaultdict
from contextlib import contextmanager
from past.builtins import long from past.builtins import long
from past.types import basestring from past.types import basestring
from numbers import Number from numbers import Number
@ -54,15 +52,14 @@ from devlib.platform import Platform
from devlib.exception import (DevlibTransientError, TargetStableError, from devlib.exception import (DevlibTransientError, TargetStableError,
TargetNotRespondingError, TimeoutError, TargetNotRespondingError, TimeoutError,
TargetTransientError, KernelConfigKeyError, TargetTransientError, KernelConfigKeyError,
TargetError, HostError, TargetCalledProcessError, TargetError, HostError, TargetCalledProcessError)
TargetStableCalledProcessError) # pylint: disable=redefined-builtin
from devlib.utils.ssh import SshConnection from devlib.utils.ssh import SshConnection
from devlib.utils.android import AdbConnection, AndroidProperties, LogcatMonitor, adb_command, adb_disconnect, INTENT_FLAGS from devlib.utils.android import AdbConnection, AndroidProperties, LogcatMonitor, adb_command, INTENT_FLAGS
from devlib.utils.misc import memoized, isiterable, convert_new_lines, groupby_value from devlib.utils.misc import memoized, isiterable, convert_new_lines, groupby_value
from devlib.utils.misc import commonprefix, merge_lists from devlib.utils.misc import commonprefix, merge_lists
from devlib.utils.misc import ABI_MAP, get_cpu_name, ranges_to_list from devlib.utils.misc import ABI_MAP, get_cpu_name, ranges_to_list
from devlib.utils.misc import batch_contextmanager, tls_property, _BoundTLSProperty, nullcontext from devlib.utils.misc import batch_contextmanager, tls_property, _BoundTLSProperty, nullcontext
from devlib.utils.misc import strip_bash_colors, safe_extract from devlib.utils.misc import safe_extract
from devlib.utils.types import integer, boolean, bitmask, identifier, caseless_string, bytes_regex from devlib.utils.types import integer, boolean, bitmask, identifier, caseless_string, bytes_regex
import devlib.utils.asyn as asyn import devlib.utils.asyn as asyn

View File

@ -1,4 +1,4 @@
# Copyright 2018 ARM Limited # Copyright 2024 ARM Limited
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -54,7 +54,6 @@ responsibility of the calling code to ensure that the file is closed properly.
''' '''
import csv import csv
import sys
from contextlib import contextmanager from contextlib import contextmanager

View File

@ -1,4 +1,4 @@
# Copyright 2013-2018 ARM Limited # Copyright 2013-2024 ARM Limited
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -22,23 +22,21 @@ from contextlib import contextmanager
from functools import partial, reduce, wraps from functools import partial, reduce, wraps
from itertools import groupby from itertools import groupby
from operator import itemgetter from operator import itemgetter
from weakref import WeakKeyDictionary, WeakSet from weakref import WeakSet
import ctypes import ctypes
import functools
import logging import logging
import os import os
import pkgutil import pkgutil
import random import random
import re import re
import signal
import string import string
import subprocess import subprocess
import sys import sys
import threading import threading
import types import types
import wrapt
import warnings import warnings
import wrapt
try: try:

View File

@ -1,4 +1,4 @@
# Copyright 2013-2018 ARM Limited # Copyright 2013-2024 ARM Limited
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -13,16 +13,13 @@
# limitations under the License. # limitations under the License.
# #
import time import time
from contextlib import contextmanager from contextlib import contextmanager
from logging import Logger from logging import Logger
import serial import serial
# pylint: disable=import-error,wrong-import-position,ungrouped-imports,wrong-import-order # pylint: disable=ungrouped-imports
import pexpect
try: try:
from pexpect import fdpexpect from pexpect import fdpexpect
# pexpect < 4.0.0 does not have fdpexpect module # pexpect < 4.0.0 does not have fdpexpect module

View File

@ -1,4 +1,4 @@
# Copyright 2014-2018 ARM Limited # Copyright 2014-2024 ARM Limited
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -14,7 +14,6 @@
# #
import glob
import os import os
import stat import stat
import logging import logging
@ -22,13 +21,11 @@ import subprocess
import re import re
import threading import threading
import tempfile import tempfile
import shutil
import socket import socket
import sys import sys
import time import time
import atexit import atexit
import contextlib import contextlib
import weakref
import select import select
import copy import copy
import functools import functools
@ -60,8 +57,7 @@ from devlib.exception import (HostError, TargetStableError, TargetNotRespondingE
from devlib.utils.misc import (which, strip_bash_colors, check_output, from devlib.utils.misc import (which, strip_bash_colors, check_output,
sanitize_cmd_template, memoized, redirect_streams) sanitize_cmd_template, memoized, redirect_streams)
from devlib.utils.types import boolean from devlib.utils.types import boolean
from devlib.connection import (ConnectionBase, ParamikoBackgroundCommand, PopenBackgroundCommand, from devlib.connection import ConnectionBase, ParamikoBackgroundCommand, SSHTransferHandle
SSHTransferHandle)
DEFAULT_SSH_SUDO_COMMAND = "sudo -k -p ' ' -S -- sh -c {}" DEFAULT_SSH_SUDO_COMMAND = "sudo -k -p ' ' -S -- sh -c {}"