scripts: Fix twisterlib for ruff - I001
This fixes the error I001 - unsorted imports. Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
This commit is contained in:
parent
a29236d808
commit
240cb62bdf
19 changed files with 120 additions and 132 deletions
|
@ -760,7 +760,6 @@
|
||||||
]
|
]
|
||||||
"./scripts/pylib/twister/twisterlib/cmakecache.py" = [
|
"./scripts/pylib/twister/twisterlib/cmakecache.py" = [
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if
|
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if
|
||||||
"SIM114", # https://docs.astral.sh/ruff/rules/if-with-same-arms
|
"SIM114", # https://docs.astral.sh/ruff/rules/if-with-same-arms
|
||||||
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
||||||
|
@ -769,7 +768,6 @@
|
||||||
"./scripts/pylib/twister/twisterlib/config_parser.py" = [
|
"./scripts/pylib/twister/twisterlib/config_parser.py" = [
|
||||||
"B028", # https://docs.astral.sh/ruff/rules/no-explicit-stacklevel
|
"B028", # https://docs.astral.sh/ruff/rules/no-explicit-stacklevel
|
||||||
"B904", # https://docs.astral.sh/ruff/rules/raise-without-from-inside-except
|
"B904", # https://docs.astral.sh/ruff/rules/raise-without-from-inside-except
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"SIM401", # https://docs.astral.sh/ruff/rules/if-else-block-instead-of-dict-get
|
"SIM401", # https://docs.astral.sh/ruff/rules/if-else-block-instead-of-dict-get
|
||||||
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation
|
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation
|
||||||
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
||||||
|
@ -778,7 +776,6 @@
|
||||||
"B905", # https://docs.astral.sh/ruff/rules/zip-without-explicit-strict
|
"B905", # https://docs.astral.sh/ruff/rules/zip-without-explicit-strict
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"SIM105", # https://docs.astral.sh/ruff/rules/suppressible-exception
|
"SIM105", # https://docs.astral.sh/ruff/rules/suppressible-exception
|
||||||
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
||||||
"UP022", # https://docs.astral.sh/ruff/rules/replace-stdout-stderr
|
"UP022", # https://docs.astral.sh/ruff/rules/replace-stdout-stderr
|
||||||
|
@ -788,7 +785,6 @@
|
||||||
"./scripts/pylib/twister/twisterlib/environment.py" = [
|
"./scripts/pylib/twister/twisterlib/environment.py" = [
|
||||||
"B006", # https://docs.astral.sh/ruff/rules/mutable-argument-default
|
"B006", # https://docs.astral.sh/ruff/rules/mutable-argument-default
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"SIM118", # https://docs.astral.sh/ruff/rules/in-dict-keys
|
"SIM118", # https://docs.astral.sh/ruff/rules/in-dict-keys
|
||||||
"UP006", # https://docs.astral.sh/ruff/rules/non-pep585-annotation
|
"UP006", # https://docs.astral.sh/ruff/rules/non-pep585-annotation
|
||||||
"UP021", # https://docs.astral.sh/ruff/rules/replace-universal-newlines
|
"UP021", # https://docs.astral.sh/ruff/rules/replace-universal-newlines
|
||||||
|
@ -797,7 +793,6 @@
|
||||||
"./scripts/pylib/twister/twisterlib/handlers.py" = [
|
"./scripts/pylib/twister/twisterlib/handlers.py" = [
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if
|
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if
|
||||||
"SIM105", # https://docs.astral.sh/ruff/rules/suppressible-exception
|
"SIM105", # https://docs.astral.sh/ruff/rules/suppressible-exception
|
||||||
"SIM114", # https://docs.astral.sh/ruff/rules/if-with-same-arms
|
"SIM114", # https://docs.astral.sh/ruff/rules/if-with-same-arms
|
||||||
|
@ -812,7 +807,6 @@
|
||||||
"./scripts/pylib/twister/twisterlib/hardwaremap.py" = [
|
"./scripts/pylib/twister/twisterlib/hardwaremap.py" = [
|
||||||
"B006", # https://docs.astral.sh/ruff/rules/mutable-argument-default
|
"B006", # https://docs.astral.sh/ruff/rules/mutable-argument-default
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"SIM118", # https://docs.astral.sh/ruff/rules/in-dict-keys
|
"SIM118", # https://docs.astral.sh/ruff/rules/in-dict-keys
|
||||||
"UP004", # https://docs.astral.sh/ruff/rules/useless-object-inheritance
|
"UP004", # https://docs.astral.sh/ruff/rules/useless-object-inheritance
|
||||||
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
||||||
|
@ -825,7 +819,6 @@
|
||||||
"E713", # https://docs.astral.sh/ruff/rules/not-in-test
|
"E713", # https://docs.astral.sh/ruff/rules/not-in-test
|
||||||
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
||||||
"F811", # https://docs.astral.sh/ruff/rules/redefined-while-unused
|
"F811", # https://docs.astral.sh/ruff/rules/redefined-while-unused
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if
|
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if
|
||||||
"SIM300", # https://docs.astral.sh/ruff/rules/yoda-conditions
|
"SIM300", # https://docs.astral.sh/ruff/rules/yoda-conditions
|
||||||
"UP008", # https://docs.astral.sh/ruff/rules/super-call-with-parameters
|
"UP008", # https://docs.astral.sh/ruff/rules/super-call-with-parameters
|
||||||
|
@ -840,18 +833,15 @@
|
||||||
"UP004", # https://docs.astral.sh/ruff/rules/useless-object-inheritance
|
"UP004", # https://docs.astral.sh/ruff/rules/useless-object-inheritance
|
||||||
]
|
]
|
||||||
"./scripts/pylib/twister/twisterlib/package.py" = [
|
"./scripts/pylib/twister/twisterlib/package.py" = [
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
||||||
]
|
]
|
||||||
"./scripts/pylib/twister/twisterlib/platform.py" = [
|
"./scripts/pylib/twister/twisterlib/platform.py" = [
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
||||||
]
|
]
|
||||||
"./scripts/pylib/twister/twisterlib/quarantine.py" = [
|
"./scripts/pylib/twister/twisterlib/quarantine.py" = [
|
||||||
"B006", # https://docs.astral.sh/ruff/rules/mutable-argument-default
|
"B006", # https://docs.astral.sh/ruff/rules/mutable-argument-default
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"SIM110", # https://docs.astral.sh/ruff/rules/reimplemented-builtin
|
"SIM110", # https://docs.astral.sh/ruff/rules/reimplemented-builtin
|
||||||
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
||||||
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
||||||
|
@ -859,7 +849,6 @@
|
||||||
"./scripts/pylib/twister/twisterlib/reports.py" = [
|
"./scripts/pylib/twister/twisterlib/reports.py" = [
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
||||||
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
||||||
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
||||||
|
@ -869,7 +858,6 @@
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"E713", # https://docs.astral.sh/ruff/rules/not-in-test
|
"E713", # https://docs.astral.sh/ruff/rules/not-in-test
|
||||||
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if
|
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if
|
||||||
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
|
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
|
||||||
"SIM201", # https://docs.astral.sh/ruff/rules/negate-equal-op
|
"SIM201", # https://docs.astral.sh/ruff/rules/negate-equal-op
|
||||||
|
@ -882,20 +870,17 @@
|
||||||
]
|
]
|
||||||
"./scripts/pylib/twister/twisterlib/size_calc.py" = [
|
"./scripts/pylib/twister/twisterlib/size_calc.py" = [
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"UP006", # https://docs.astral.sh/ruff/rules/non-pep585-annotation
|
"UP006", # https://docs.astral.sh/ruff/rules/non-pep585-annotation
|
||||||
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
||||||
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
||||||
]
|
]
|
||||||
"./scripts/pylib/twister/twisterlib/statuses.py" = [
|
"./scripts/pylib/twister/twisterlib/statuses.py" = [
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"SIM401", # https://docs.astral.sh/ruff/rules/if-else-block-instead-of-dict-get
|
"SIM401", # https://docs.astral.sh/ruff/rules/if-else-block-instead-of-dict-get
|
||||||
]
|
]
|
||||||
"./scripts/pylib/twister/twisterlib/testinstance.py" = [
|
"./scripts/pylib/twister/twisterlib/testinstance.py" = [
|
||||||
"B006", # https://docs.astral.sh/ruff/rules/mutable-argument-default
|
"B006", # https://docs.astral.sh/ruff/rules/mutable-argument-default
|
||||||
"B904", # https://docs.astral.sh/ruff/rules/raise-without-from-inside-except
|
"B904", # https://docs.astral.sh/ruff/rules/raise-without-from-inside-except
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if
|
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if
|
||||||
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
||||||
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
||||||
|
@ -910,7 +895,6 @@
|
||||||
"E741", # https://docs.astral.sh/ruff/rules/ambiguous-variable-name
|
"E741", # https://docs.astral.sh/ruff/rules/ambiguous-variable-name
|
||||||
"F401", # https://docs.astral.sh/ruff/rules/unused-import
|
"F401", # https://docs.astral.sh/ruff/rules/unused-import
|
||||||
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if
|
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if
|
||||||
"SIM110", # https://docs.astral.sh/ruff/rules/reimplemented-builtin
|
"SIM110", # https://docs.astral.sh/ruff/rules/reimplemented-builtin
|
||||||
"SIM118", # https://docs.astral.sh/ruff/rules/in-dict-keys
|
"SIM118", # https://docs.astral.sh/ruff/rules/in-dict-keys
|
||||||
|
@ -923,14 +907,12 @@
|
||||||
"B006", # https://docs.astral.sh/ruff/rules/mutable-argument-default
|
"B006", # https://docs.astral.sh/ruff/rules/mutable-argument-default
|
||||||
"B904", # https://docs.astral.sh/ruff/rules/raise-without-from-inside-except
|
"B904", # https://docs.astral.sh/ruff/rules/raise-without-from-inside-except
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"UP006", # https://docs.astral.sh/ruff/rules/non-pep585-annotation
|
"UP006", # https://docs.astral.sh/ruff/rules/non-pep585-annotation
|
||||||
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
||||||
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
||||||
]
|
]
|
||||||
"./scripts/pylib/twister/twisterlib/twister_main.py" = [
|
"./scripts/pylib/twister/twisterlib/twister_main.py" = [
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
||||||
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
||||||
]
|
]
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
import re
|
import re
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
|
||||||
class CMakeCacheEntry:
|
class CMakeCacheEntry:
|
||||||
'''Represents a CMake cache entry.
|
'''Represents a CMake cache entry.
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,13 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import scl
|
|
||||||
import warnings
|
import warnings
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
|
import scl
|
||||||
from twisterlib.error import ConfigurationError
|
from twisterlib.error import ConfigurationError
|
||||||
|
|
||||||
|
|
||||||
def extract_fields_from_arg_list(target_fields: set, arg_list: Union[str, list]):
|
def extract_fields_from_arg_list(target_fields: set, arg_list: Union[str, list]):
|
||||||
"""
|
"""
|
||||||
Given a list of "FIELD=VALUE" args, extract values of args with a
|
Given a list of "FIELD=VALUE" args, extract values of args with a
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
# Copyright (c) 2018-2022 Intel Corporation
|
# Copyright (c) 2018-2022 Intel Corporation
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import sys
|
import glob
|
||||||
import os
|
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import glob
|
import sys
|
||||||
import re
|
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
logger = logging.getLogger('twister')
|
logger = logging.getLogger('twister')
|
||||||
|
|
|
@ -15,16 +15,16 @@ import re
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
from collections.abc import Generator
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
from importlib import metadata
|
from importlib import metadata
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from collections.abc import Generator
|
|
||||||
|
|
||||||
|
import zephyr_module
|
||||||
from twisterlib.constants import SUPPORTED_SIMS
|
from twisterlib.constants import SUPPORTED_SIMS
|
||||||
from twisterlib.coverage import supported_coverage_formats
|
from twisterlib.coverage import supported_coverage_formats
|
||||||
from twisterlib.error import TwisterRuntimeError
|
from twisterlib.error import TwisterRuntimeError
|
||||||
from twisterlib.log_helper import log_command
|
from twisterlib.log_helper import log_command
|
||||||
import zephyr_module
|
|
||||||
|
|
||||||
logger = logging.getLogger('twister')
|
logger = logging.getLogger('twister')
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
|
|
|
@ -11,7 +11,6 @@ import argparse
|
||||||
import logging
|
import logging
|
||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
import psutil
|
|
||||||
import re
|
import re
|
||||||
import select
|
import select
|
||||||
import shlex
|
import shlex
|
||||||
|
@ -20,15 +19,16 @@ import subprocess
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from queue import Queue, Empty
|
from queue import Empty, Queue
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
|
import psutil
|
||||||
from twisterlib.environment import ZEPHYR_BASE, strip_ansi_sequences
|
from twisterlib.environment import ZEPHYR_BASE, strip_ansi_sequences
|
||||||
from twisterlib.error import TwisterException
|
from twisterlib.error import TwisterException
|
||||||
from twisterlib.platform import Platform
|
from twisterlib.platform import Platform
|
||||||
from twisterlib.statuses import TwisterStatus
|
from twisterlib.statuses import TwisterStatus
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/build_helpers"))
|
sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/build_helpers"))
|
||||||
from domains import Domains
|
from domains import Domains
|
||||||
|
|
|
@ -4,26 +4,25 @@
|
||||||
# Copyright (c) 2022 Intel Corporation
|
# Copyright (c) 2022 Intel Corporation
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import os
|
|
||||||
from multiprocessing import Lock, Value
|
|
||||||
import re
|
|
||||||
|
|
||||||
import platform
|
|
||||||
import yaml
|
|
||||||
import scl
|
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
import platform
|
||||||
|
import re
|
||||||
|
from multiprocessing import Lock, Value
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from natsort import natsorted
|
|
||||||
|
|
||||||
|
import scl
|
||||||
|
import yaml
|
||||||
|
from natsort import natsorted
|
||||||
from twisterlib.environment import ZEPHYR_BASE
|
from twisterlib.environment import ZEPHYR_BASE
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Use the C LibYAML parser if available, rather than the Python parser.
|
# Use the C LibYAML parser if available, rather than the Python parser.
|
||||||
# It's much faster.
|
# It's much faster.
|
||||||
from yaml import CSafeLoader as SafeLoader
|
|
||||||
from yaml import CDumper as Dumper
|
from yaml import CDumper as Dumper
|
||||||
|
from yaml import CSafeLoader as SafeLoader
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from yaml import SafeLoader, Dumper
|
from yaml import Dumper, SafeLoader
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from tabulate import tabulate
|
from tabulate import tabulate
|
||||||
|
|
|
@ -1,29 +1,30 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from asyncio.log import logger
|
|
||||||
from enum import Enum
|
import json
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
import platform
|
import platform
|
||||||
import re
|
import re
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import subprocess
|
|
||||||
import shlex
|
import shlex
|
||||||
from collections import OrderedDict
|
import shutil
|
||||||
import xml.etree.ElementTree as ET
|
import subprocess
|
||||||
import logging
|
import sys
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
import shutil
|
import xml.etree.ElementTree as ET
|
||||||
import json
|
from asyncio.log import logger
|
||||||
|
from collections import OrderedDict
|
||||||
|
from enum import Enum
|
||||||
|
|
||||||
from pytest import ExitCode
|
from pytest import ExitCode
|
||||||
from twisterlib.reports import ReportStatus
|
from twisterlib.constants import SUPPORTED_SIMS_IN_PYTEST
|
||||||
|
from twisterlib.environment import PYTEST_PLUGIN_INSTALLED, ZEPHYR_BASE
|
||||||
from twisterlib.error import ConfigurationError, StatusAttributeError
|
from twisterlib.error import ConfigurationError, StatusAttributeError
|
||||||
from twisterlib.environment import ZEPHYR_BASE, PYTEST_PLUGIN_INSTALLED
|
|
||||||
from twisterlib.handlers import Handler, terminate_process
|
from twisterlib.handlers import Handler, terminate_process
|
||||||
|
from twisterlib.reports import ReportStatus
|
||||||
from twisterlib.statuses import TwisterStatus
|
from twisterlib.statuses import TwisterStatus
|
||||||
from twisterlib.testinstance import TestInstance
|
from twisterlib.testinstance import TestInstance
|
||||||
from twisterlib.constants import SUPPORTED_SIMS_IN_PYTEST
|
|
||||||
|
|
||||||
logger = logging.getLogger('twister')
|
logger = logging.getLogger('twister')
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
|
|
|
@ -3,12 +3,13 @@
|
||||||
# Copyright (c) 2020 Intel Corporation
|
# Copyright (c) 2020 Intel Corporation
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import tarfile
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import tarfile
|
||||||
|
|
||||||
from twisterlib.statuses import TwisterStatus
|
from twisterlib.statuses import TwisterStatus
|
||||||
|
|
||||||
|
|
||||||
class Artifacts:
|
class Artifacts:
|
||||||
|
|
||||||
def __init__(self, env):
|
def __init__(self, env):
|
||||||
|
|
|
@ -6,12 +6,13 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
import scl
|
import scl
|
||||||
from twisterlib.environment import ZEPHYR_BASE
|
|
||||||
from twisterlib.constants import SUPPORTED_SIMS
|
from twisterlib.constants import SUPPORTED_SIMS
|
||||||
import logging
|
from twisterlib.environment import ZEPHYR_BASE
|
||||||
|
|
||||||
logger = logging.getLogger('twister')
|
logger = logging.getLogger('twister')
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
|
|
|
@ -7,10 +7,10 @@ from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
import yaml
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from yaml import CSafeLoader as SafeLoader
|
from yaml import CSafeLoader as SafeLoader
|
||||||
|
|
|
@ -4,16 +4,16 @@
|
||||||
# Copyright (c) 2018 Intel Corporation
|
# Copyright (c) 2018 Intel Corporation
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
from enum import Enum
|
|
||||||
import os
|
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
from colorama import Fore
|
import os
|
||||||
import xml.etree.ElementTree as ET
|
|
||||||
import string
|
import string
|
||||||
|
import xml.etree.ElementTree as ET
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from enum import Enum
|
||||||
from pathlib import PosixPath
|
from pathlib import PosixPath
|
||||||
|
|
||||||
|
from colorama import Fore
|
||||||
from twisterlib.statuses import TwisterStatus
|
from twisterlib.statuses import TwisterStatus
|
||||||
|
|
||||||
logger = logging.getLogger('twister')
|
logger = logging.getLogger('twister')
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from math import log10
|
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import os
|
import os
|
||||||
|
import pathlib
|
||||||
import pickle
|
import pickle
|
||||||
import queue
|
import queue
|
||||||
import re
|
import re
|
||||||
|
@ -16,23 +16,22 @@ import subprocess
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
import yaml
|
from math import log10
|
||||||
from multiprocessing import Lock, Process, Value
|
from multiprocessing import Lock, Process, Value
|
||||||
from multiprocessing.managers import BaseManager
|
from multiprocessing.managers import BaseManager
|
||||||
from packaging import version
|
|
||||||
import pathlib
|
|
||||||
|
|
||||||
|
import elftools
|
||||||
|
import yaml
|
||||||
from colorama import Fore
|
from colorama import Fore
|
||||||
from domains import Domains
|
from domains import Domains
|
||||||
|
from elftools.elf.elffile import ELFFile
|
||||||
|
from elftools.elf.sections import SymbolTableSection
|
||||||
|
from packaging import version
|
||||||
from twisterlib.cmakecache import CMakeCache
|
from twisterlib.cmakecache import CMakeCache
|
||||||
from twisterlib.environment import canonical_zephyr_base
|
from twisterlib.environment import canonical_zephyr_base
|
||||||
from twisterlib.error import BuildError, ConfigurationError, StatusAttributeError
|
from twisterlib.error import BuildError, ConfigurationError, StatusAttributeError
|
||||||
from twisterlib.statuses import TwisterStatus
|
from twisterlib.statuses import TwisterStatus
|
||||||
|
|
||||||
import elftools
|
|
||||||
from elftools.elf.elffile import ELFFile
|
|
||||||
from elftools.elf.sections import SymbolTableSection
|
|
||||||
|
|
||||||
if version.parse(elftools.__version__) < version.parse('0.24'):
|
if version.parse(elftools.__version__) < version.parse('0.24'):
|
||||||
sys.exit("pyelftools is out of date, need version 0.24 or later")
|
sys.exit("pyelftools is out of date, need version 0.24 or later")
|
||||||
|
|
||||||
|
@ -40,13 +39,13 @@ if version.parse(elftools.__version__) < version.parse('0.24'):
|
||||||
if sys.platform == 'linux':
|
if sys.platform == 'linux':
|
||||||
from twisterlib.jobserver import GNUMakeJobClient, GNUMakeJobServer, JobClient
|
from twisterlib.jobserver import GNUMakeJobClient, GNUMakeJobServer, JobClient
|
||||||
|
|
||||||
from twisterlib.log_helper import log_command
|
|
||||||
from twisterlib.testinstance import TestInstance
|
|
||||||
from twisterlib.environment import TwisterEnv
|
from twisterlib.environment import TwisterEnv
|
||||||
from twisterlib.testsuite import TestSuite
|
|
||||||
from twisterlib.platform import Platform
|
|
||||||
from twisterlib.testplan import change_skip_to_error_if_integration
|
|
||||||
from twisterlib.harness import HarnessImporter, Pytest
|
from twisterlib.harness import HarnessImporter, Pytest
|
||||||
|
from twisterlib.log_helper import log_command
|
||||||
|
from twisterlib.platform import Platform
|
||||||
|
from twisterlib.testinstance import TestInstance
|
||||||
|
from twisterlib.testplan import change_skip_to_error_if_integration
|
||||||
|
from twisterlib.testsuite import TestSuite
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from yaml import CSafeLoader as SafeLoader
|
from yaml import CSafeLoader as SafeLoader
|
||||||
|
|
|
@ -4,12 +4,13 @@
|
||||||
# Copyright (c) 2018 Intel Corporation
|
# Copyright (c) 2018 Intel Corporation
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import subprocess
|
import logging
|
||||||
import sys
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
import typing
|
import typing
|
||||||
import logging
|
|
||||||
from twisterlib.error import TwisterRuntimeError
|
from twisterlib.error import TwisterRuntimeError
|
||||||
|
|
||||||
logger = logging.getLogger('twister')
|
logger = logging.getLogger('twister')
|
||||||
|
|
|
@ -7,9 +7,10 @@ Status classes to be used instead of str statuses.
|
||||||
"""
|
"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from colorama import Fore
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
|
from colorama import Fore
|
||||||
|
|
||||||
|
|
||||||
class TwisterStatus(str, Enum):
|
class TwisterStatus(str, Enum):
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
|
@ -6,33 +6,34 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from enum import Enum
|
|
||||||
import os
|
|
||||||
import hashlib
|
|
||||||
import random
|
|
||||||
import logging
|
|
||||||
import glob
|
|
||||||
import csv
|
|
||||||
|
|
||||||
from twisterlib.environment import TwisterEnv
|
import csv
|
||||||
from twisterlib.testsuite import TestCase, TestSuite
|
import glob
|
||||||
from twisterlib.platform import Platform
|
import hashlib
|
||||||
from twisterlib.error import BuildError, StatusAttributeError
|
import logging
|
||||||
from twisterlib.size_calc import SizeCalculator
|
import os
|
||||||
from twisterlib.statuses import TwisterStatus
|
import random
|
||||||
from twisterlib.handlers import (
|
from enum import Enum
|
||||||
Handler,
|
|
||||||
SimulationHandler,
|
|
||||||
BinaryHandler,
|
|
||||||
QEMUHandler,
|
|
||||||
QEMUWinHandler,
|
|
||||||
DeviceHandler,
|
|
||||||
)
|
|
||||||
from twisterlib.constants import (
|
from twisterlib.constants import (
|
||||||
SUPPORTED_SIMS,
|
SUPPORTED_SIMS,
|
||||||
SUPPORTED_SIMS_IN_PYTEST,
|
SUPPORTED_SIMS_IN_PYTEST,
|
||||||
SUPPORTED_SIMS_WITH_EXEC,
|
SUPPORTED_SIMS_WITH_EXEC,
|
||||||
)
|
)
|
||||||
|
from twisterlib.environment import TwisterEnv
|
||||||
|
from twisterlib.error import BuildError, StatusAttributeError
|
||||||
|
from twisterlib.handlers import (
|
||||||
|
BinaryHandler,
|
||||||
|
DeviceHandler,
|
||||||
|
Handler,
|
||||||
|
QEMUHandler,
|
||||||
|
QEMUWinHandler,
|
||||||
|
SimulationHandler,
|
||||||
|
)
|
||||||
|
from twisterlib.platform import Platform
|
||||||
|
from twisterlib.size_calc import SizeCalculator
|
||||||
|
from twisterlib.statuses import TwisterStatus
|
||||||
|
from twisterlib.testsuite import TestCase, TestSuite
|
||||||
|
|
||||||
logger = logging.getLogger('twister')
|
logger = logging.getLogger('twister')
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
|
|
|
@ -5,37 +5,37 @@
|
||||||
# Copyright (c) 2024 Arm Limited (or its affiliates). All rights reserved.
|
# Copyright (c) 2024 Arm Limited (or its affiliates). All rights reserved.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
import os
|
import collections
|
||||||
import sys
|
import copy
|
||||||
import re
|
|
||||||
import subprocess
|
|
||||||
import glob
|
import glob
|
||||||
import json
|
import json
|
||||||
import collections
|
import logging
|
||||||
|
import os
|
||||||
|
import random
|
||||||
|
import re
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
from argparse import Namespace
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from itertools import islice
|
from itertools import islice
|
||||||
import logging
|
|
||||||
import copy
|
|
||||||
import random
|
|
||||||
import snippets
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from argparse import Namespace
|
|
||||||
|
import snippets
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from anytree import RenderTree, Node, find
|
from anytree import Node, RenderTree, find
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print("Install the anytree module to use the --test-tree option")
|
print("Install the anytree module to use the --test-tree option")
|
||||||
|
|
||||||
from twisterlib.testsuite import TestSuite, scan_testsuite_path
|
import list_boards
|
||||||
|
import scl
|
||||||
|
from twisterlib.config_parser import TwisterConfigParser
|
||||||
from twisterlib.error import TwisterRuntimeError
|
from twisterlib.error import TwisterRuntimeError
|
||||||
from twisterlib.platform import Platform
|
from twisterlib.platform import Platform
|
||||||
from twisterlib.config_parser import TwisterConfigParser
|
from twisterlib.quarantine import Quarantine
|
||||||
from twisterlib.statuses import TwisterStatus
|
from twisterlib.statuses import TwisterStatus
|
||||||
from twisterlib.testinstance import TestInstance
|
from twisterlib.testinstance import TestInstance
|
||||||
from twisterlib.quarantine import Quarantine
|
from twisterlib.testsuite import TestSuite, scan_testsuite_path
|
||||||
|
|
||||||
import scl
|
|
||||||
import list_boards
|
|
||||||
from zephyr_module import parse_modules
|
from zephyr_module import parse_modules
|
||||||
|
|
||||||
logger = logging.getLogger('twister')
|
logger = logging.getLogger('twister')
|
||||||
|
|
|
@ -3,18 +3,18 @@
|
||||||
# Copyright (c) 2018-2024 Intel Corporation
|
# Copyright (c) 2018-2024 Intel Corporation
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
from enum import Enum
|
|
||||||
import os
|
|
||||||
from pathlib import Path
|
|
||||||
import re
|
|
||||||
import logging
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import mmap
|
|
||||||
import glob
|
import glob
|
||||||
|
import logging
|
||||||
|
import mmap
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
from enum import Enum
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from twisterlib.mixins import DisablePyTestCollectionMixin
|
|
||||||
from twisterlib.environment import canonical_zephyr_base
|
from twisterlib.environment import canonical_zephyr_base
|
||||||
from twisterlib.error import StatusAttributeError, TwisterException, TwisterRuntimeError
|
from twisterlib.error import StatusAttributeError, TwisterException, TwisterRuntimeError
|
||||||
|
from twisterlib.mixins import DisablePyTestCollectionMixin
|
||||||
from twisterlib.statuses import TwisterStatus
|
from twisterlib.statuses import TwisterStatus
|
||||||
|
|
||||||
logger = logging.getLogger('twister')
|
logger = logging.getLogger('twister')
|
||||||
|
|
|
@ -4,23 +4,22 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import colorama
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
import colorama
|
||||||
from colorama import Fore
|
from colorama import Fore
|
||||||
|
from twisterlib.coverage import run_coverage
|
||||||
|
from twisterlib.environment import TwisterEnv
|
||||||
|
from twisterlib.hardwaremap import HardwareMap
|
||||||
|
from twisterlib.package import Artifacts
|
||||||
|
from twisterlib.reports import Reporting
|
||||||
|
from twisterlib.runner import TwisterRunner
|
||||||
from twisterlib.statuses import TwisterStatus
|
from twisterlib.statuses import TwisterStatus
|
||||||
from twisterlib.testplan import TestPlan
|
from twisterlib.testplan import TestPlan
|
||||||
from twisterlib.reports import Reporting
|
|
||||||
from twisterlib.hardwaremap import HardwareMap
|
|
||||||
from twisterlib.coverage import run_coverage
|
|
||||||
from twisterlib.runner import TwisterRunner
|
|
||||||
from twisterlib.environment import TwisterEnv
|
|
||||||
from twisterlib.package import Artifacts
|
|
||||||
|
|
||||||
logger = logging.getLogger("twister")
|
logger = logging.getLogger("twister")
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue