diff --git a/.flake8 b/.flake8 index ec46f5ba167b4e..95261687837818 100644 --- a/.flake8 +++ b/.flake8 @@ -11,7 +11,6 @@ exclude = third_party src/test_driver/openiotsdk/* src/test_driver/mbed/* src/test_driver/linux-cirque/* - src/test_driver/esp32/* build/chip/java/tests/* build/chip/linux/* build/config/linux/* @@ -25,7 +24,6 @@ exclude = third_party scripts/build/builders/android.py scripts/build/builders/bouffalolab.py scripts/build/builders/cc13x2x7_26x2x7.py - scripts/build/builders/esp32.py scripts/build/builders/genio.py scripts/build/builders/gn.py scripts/build/builders/imx.py @@ -58,7 +56,6 @@ exclude = third_party scripts/tests/chiptest/yamltest_with_chip_repl_tester.py scripts/tools/check_zcl_file_sync.py scripts/tools/convert_ini.py - scripts/tools/generate_esp32_chip_factory_bin.py scripts/tools/memory/memdf/__init__.py scripts/tools/memory/report_summary.py scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py diff --git a/scripts/build/builders/esp32.py b/scripts/build/builders/esp32.py index 456ebc09c7f0c2..b6685e1af19895 100644 --- a/scripts/build/builders/esp32.py +++ b/scripts/build/builders/esp32.py @@ -100,7 +100,8 @@ def IsCompatible(self, board: Esp32Board): if board == Esp32Board.QEMU: return self == Esp32App.TESTS elif board == Esp32Board.M5Stack: - return self == Esp32App.ALL_CLUSTERS or self == Esp32App.ALL_CLUSTERS_MINIMAL or self == Esp32App.OTA_REQUESTOR or self == Esp32App.OTA_PROVIDER + return (self == Esp32App.ALL_CLUSTERS or self == Esp32App.ALL_CLUSTERS_MINIMAL or + self == Esp32App.OTA_REQUESTOR or self == Esp32App.OTA_PROVIDER) elif board == Esp32Board.C3DevKit: return self == Esp32App.ALL_CLUSTERS or self == Esp32App.ALL_CLUSTERS_MINIMAL else: @@ -244,5 +245,5 @@ def flashbundle(self): with open(os.path.join(self.output_dir, self.app.FlashBundleName), 'r') as fp: return { - l.strip(): os.path.join(self.output_dir, l.strip()) for l in fp.readlines() if l.strip() + line.strip(): os.path.join(self.output_dir, line.strip()) for line in fp.readlines() if line.strip() } diff --git a/scripts/tools/generate_esp32_chip_factory_bin.py b/scripts/tools/generate_esp32_chip_factory_bin.py index 69ee282cf83aa9..a88e999d1010ea 100755 --- a/scripts/tools/generate_esp32_chip_factory_bin.py +++ b/scripts/tools/generate_esp32_chip_factory_bin.py @@ -21,8 +21,6 @@ import enum import logging import os -import shutil -import subprocess import sys from types import SimpleNamespace @@ -198,7 +196,7 @@ def calendar_types_to_uint32(calendar_types): def ishex(s): try: - n = int(s, 16) + _ = int(s, 16) return True except ValueError: return False @@ -464,11 +462,13 @@ def any_base_int(s): return int(s, 0) parser.add_argument('--mfg-date', help='Manufacturing date in format YYYY-MM-DD') parser.add_argument('--serial-num', help='Serial number') parser.add_argument('--rd-id-uid', - help='128-bit unique identifier for generating rotating device identifier, provide 32-byte hex string, e.g. "1234567890abcdef1234567890abcdef"') + help=('128-bit unique identifier for generating rotating device identifier, ' + 'provide 32-byte hex string, e.g. "1234567890abcdef1234567890abcdef"')) # These will be used by DeviceInfoProvider parser.add_argument('--calendar-types', nargs='+', - help='List of supported calendar types.\nSupported Calendar Types: Buddhist, Chinese, Coptic, Ethiopian, Gregorian, Hebrew, Indian, Islamic, Japanese, Korean, Persian, Taiwanese') + help=('List of supported calendar types.\nSupported Calendar Types: Buddhist, Chinese, Coptic, Ethiopian, ' + 'Gregorian, Hebrew, Indian, Islamic, Japanese, Korean, Persian, Taiwanese')) parser.add_argument('--locales', nargs='+', help='List of supported locales, Language Tag as defined by BCP47, eg. en-US en-GB') parser.add_argument('--fixed-labels', nargs='+', help='List of fixed labels, eg: "0/orientation/up" "1/orientation/down" "2/orientation/down"') diff --git a/src/test_driver/esp32/run_qemu_image.py b/src/test_driver/esp32/run_qemu_image.py index 6d684c95ce7df1..90e06191b121ea 100755 --- a/src/test_driver/esp32/run_qemu_image.py +++ b/src/test_driver/esp32/run_qemu_image.py @@ -17,7 +17,6 @@ import os import re import subprocess -import sys import click import coloredlogs @@ -147,7 +146,7 @@ def main(log_level, no_log_timestamps, image, file_image_list, qemu, verbose): print("========== TEST OUTPUT END ============") logging.info("Image %s PASSED", path) - except: + except Exception: # make sure output is visible in stdout print("========== TEST OUTPUT BEGIN ============") print(output)