1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-30 17:50:46 +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");
# 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,
CollectorOutputEntry)
from devlib.target import KernelConfigTristate
from devlib.exception import TargetStableError
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");
# you may not use this file except in compliance with the License.
@ -14,7 +14,6 @@
#
import os
import shutil
from devlib.collector import (CollectorBase, CollectorOutput,
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");
# you may not use this file except in compliance with the License.
@ -13,8 +13,6 @@
# limitations under the License.
#
import shutil
from tempfile import NamedTemporaryFile
from pexpect.exceptions import TIMEOUT
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");
# you may not use this file except in compliance with the License.
@ -16,9 +16,6 @@
import os
import subprocess
from shutil import copyfile
from tempfile import NamedTemporaryFile
from devlib.collector import (CollectorBase, CollectorOutput,
CollectorOutputEntry)
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");
# you may not use this file except in compliance with the License.
@ -15,13 +15,9 @@
from abc import ABC, abstractmethod
from contextlib import contextmanager, nullcontext
from datetime import datetime
from functools import partial
from weakref import WeakSet
from shlex import quote
import os
import signal
import socket
import subprocess
import threading
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");
# 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
# limitations under the License.
#
import glob
import os
import signal
import shutil
@ -23,8 +22,7 @@ from getpass import getpass
from shlex import quote
from devlib.exception import (
TargetTransientError, TargetStableError,
TargetTransientCalledProcessError, TargetStableCalledProcessError
TargetStableError, TargetTransientCalledProcessError, TargetStableCalledProcessError
)
from devlib.utils.misc import check_output
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");
# 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
# limitations under the License.
#
from contextlib import contextmanager
from operator import itemgetter
from devlib.module import Module
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");
# you may not use this file except in compliance with the License.
@ -13,7 +13,6 @@
# limitations under the License.
#
import os
import sys
import tempfile
import time
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");
# you may not use this file except in compliance with the License.
@ -25,7 +25,6 @@ import time
import logging
import posixpath
import subprocess
import sys
import tarfile
import tempfile
import threading
@ -35,7 +34,6 @@ import copy
import inspect
import itertools
from collections import namedtuple, defaultdict
from contextlib import contextmanager
from past.builtins import long
from past.types import basestring
from numbers import Number
@ -54,15 +52,14 @@ from devlib.platform import Platform
from devlib.exception import (DevlibTransientError, TargetStableError,
TargetNotRespondingError, TimeoutError,
TargetTransientError, KernelConfigKeyError,
TargetError, HostError, TargetCalledProcessError,
TargetStableCalledProcessError) # pylint: disable=redefined-builtin
TargetError, HostError, TargetCalledProcessError)
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 commonprefix, merge_lists
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 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
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");
# 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 sys
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");
# 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 itertools import groupby
from operator import itemgetter
from weakref import WeakKeyDictionary, WeakSet
from weakref import WeakSet
import ctypes
import functools
import logging
import os
import pkgutil
import random
import re
import signal
import string
import subprocess
import sys
import threading
import types
import wrapt
import warnings
import wrapt
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");
# you may not use this file except in compliance with the License.
@ -13,16 +13,13 @@
# limitations under the License.
#
import time
from contextlib import contextmanager
from logging import Logger
import serial
# pylint: disable=import-error,wrong-import-position,ungrouped-imports,wrong-import-order
import pexpect
# pylint: disable=ungrouped-imports
try:
from pexpect import fdpexpect
# 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");
# you may not use this file except in compliance with the License.
@ -14,7 +14,6 @@
#
import glob
import os
import stat
import logging
@ -22,13 +21,11 @@ import subprocess
import re
import threading
import tempfile
import shutil
import socket
import sys
import time
import atexit
import contextlib
import weakref
import select
import copy
import functools
@ -60,8 +57,7 @@ from devlib.exception import (HostError, TargetStableError, TargetNotRespondingE
from devlib.utils.misc import (which, strip_bash_colors, check_output,
sanitize_cmd_template, memoized, redirect_streams)
from devlib.utils.types import boolean
from devlib.connection import (ConnectionBase, ParamikoBackgroundCommand, PopenBackgroundCommand,
SSHTransferHandle)
from devlib.connection import ConnectionBase, ParamikoBackgroundCommand, SSHTransferHandle
DEFAULT_SSH_SUDO_COMMAND = "sudo -k -p ' ' -S -- sh -c {}"