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

devlib: Remove "future"

Remove the "future" dependency as devlib does not support Python 2
anymore.

Also remove the "from __future__ import division" as this is the default
in Python 3.
This commit is contained in:
Douglas Raillard 2023-01-13 12:46:27 +00:00 committed by Marc Bonnici
parent 111aa327ce
commit 93ada9762d
16 changed files with 3 additions and 20 deletions

View File

@ -13,7 +13,6 @@
# limitations under the License.
#
from __future__ import division
import re
from itertools import takewhile
from datetime import timedelta

View File

@ -13,7 +13,6 @@
# limitations under the License.
#
from __future__ import division
import os
import json
import time

View File

@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import division
from collections import defaultdict
from devlib.derived import DerivedMeasurements, DerivedMetric

View File

@ -13,7 +13,6 @@
# limitations under the License.
#
from __future__ import division
import os
try:

View File

@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import division
import logging
import collections

View File

@ -14,7 +14,6 @@
#
#pylint: disable=attribute-defined-outside-init
from __future__ import division
import os
import sys
import time

View File

@ -30,7 +30,6 @@
# pylint: disable=W0613,E1101,access-member-before-definition,attribute-defined-outside-init
from __future__ import division
import os
import shutil
import signal

View File

@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import division
import os
import signal
import tempfile

View File

@ -13,7 +13,6 @@
# limitations under the License.
#
from __future__ import division
import os
from devlib.instrument import (Instrument, CONTINUOUS,

View File

@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import division
from devlib.platform.gem5 import Gem5SimulationPlatform
from devlib.instrument import Instrument, CONTINUOUS, MeasurementsCsv
from devlib.exception import TargetStableError

View File

@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import division
import re
from devlib.instrument import Instrument, Measurement, INSTANTANEOUS

View File

@ -18,8 +18,7 @@ import re
import tempfile
from datetime import datetime
from collections import defaultdict
from future.moves.itertools import zip_longest
from itertools import zip_longest
from devlib.instrument import Instrument, MeasurementsCsv, CONTINUOUS
from devlib.exception import TargetStableError, HostError

View File

@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import division
import os
import sys
import tempfile

View File

@ -18,7 +18,6 @@
Miscellaneous functions that don't fit anywhere else.
"""
from __future__ import division
from contextlib import contextmanager
from functools import partial, reduce, wraps
from itertools import groupby

View File

@ -32,7 +32,6 @@ import weakref
import select
import copy
import functools
from future.utils import raise_from
from shlex import quote
from paramiko.client import SSHClient, AutoAddPolicy, RejectPolicy
@ -848,8 +847,8 @@ class TelnetConnection(SshConnectionBase):
try:
check_output(command, timeout=timeout, shell=True)
except subprocess.CalledProcessError as e:
raise_from(HostError("Failed to copy file with '{}'. Output:\n{}".format(
command_redacted, e.output)), None)
msg = f"Failed to copy file with '{command_redacted}'. Output:\n{e.output}"
raise HostError(msg) from None
except TimeoutError as e:
raise TimeoutError(command_redacted, e.output)

View File

@ -90,7 +90,6 @@ params = dict(
'paramiko', # SSH connection
'scp', # SSH connection file transfers
'wrapt', # Basic for construction of decorator functions
'future', # Python 2-3 compatibility
'numpy',
'pandas',
'lxml', # More robust xml parsing