From c5df3c4c07bf93addc85c26564c020059eabf6fe Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Wed, 6 Mar 2024 12:00:00 +0100 Subject: [PATCH] pytype_reporter: cleanup config to test files migrated to python3 Signed-off-by: Bernhard Kaindl --- pyproject.toml | 58 ++++------------------------------------------ pytype_reporter.py | 16 +++++++------ 2 files changed, 13 insertions(+), 61 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7777c598f1c..48e60ce477c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -149,65 +149,15 @@ discard_messages_matching = [ "No attribute 'group' on None", "No Node.TEXT_NODE in module xml.dom.minidom, referenced from 'xml.dom.expatbuilder'" ] -expected_to_fail = [ - "scripts/hfx_filename", - "scripts/perfmon", - # Need 2to3 -w and maybe a few other minor updates: - "scripts/hatests", - "scripts/backup-sr-metadata.py", - "scripts/restore-sr-metadata.py", - "scripts/nbd_client_manager.py", - # No attribute 'popen2' on module 'os' [module-attr] and a couple more: - "scripts/mail-alarm", - # SSLSocket.send() only accepts bytes, not unicode string as argument: - "scripts/examples/python/exportimport.py", - # Other fixes needed: - "scripts/examples/python/mini-xenrt.py", - "scripts/examples/python/XenAPI/XenAPI.py", - "scripts/examples/python/monitor-unwanted-domains.py", - "scripts/examples/python/shell.py", - "scripts/examples/smapiv2.py", - "scripts/static-vdis", - # add_interface: unsupported operand type(s) for +: str and UsbInterface - "scripts/usb_scan.py", - # TestUsbScan.assertIn() is called with wrong arguments(code not iterable) - "scripts/test_usb_scan.py", - "scripts/plugins/extauth-hook-AD.py", -] +expected_to_fail = [] [tool.pytype] inputs = [ - "scripts/hfx_filename", - "scripts/perfmon", - "scripts/static-vdis", - "scripts/Makefile", - "scripts/generate-iscsi-iqn", - "scripts/hatests", - "scripts/host-display", - "scripts/mail-alarm", - "scripts/print-custom-templates", - "scripts/probe-device-for-file", - "scripts/xe-reset-networking", - "scripts/xe-scsi-dev-map", - "scripts/examples/python", - "scripts/yum-plugins", - "scripts/*.py", - "python3/packages/*.py", - - # To be added later, - # when converted to Python3-compatible syntax: - # "ocaml/message-switch/python", - # "ocaml/idl/ocaml_backend/python", - # "ocaml/xapi-storage/python", + "python3/", + "ocaml/xcp-rrdd", ] disable = [ - "import-error", # xenfsimage, xcp.bootloader. xcp.cmd - "ignored-abstractmethod", - "ignored-metaclass", - # https://github.com/google/pytype/issues/1130, - # https://github.com/google/pytype/issues/1485: - "pyi-error", ] platform = "linux" -pythonpath = "scripts/examples/python:.:scripts:scripts/plugins:scripts/examples" +pythonpath = "" diff --git a/pytype_reporter.py b/pytype_reporter.py index 8207053d7ec..357e07a9223 100755 --- a/pytype_reporter.py +++ b/pytype_reporter.py @@ -599,13 +599,15 @@ def main(): config_file = "pyproject.toml" config = load_config(config_file, basename(__file__)) config.setdefault("expected_to_fail", []) - debug("Expected to fail: %s", ", ".join(config["expected_to_fail"])) - - changed_but_in_expected_to_fail = git_diff( - "--name-only", - find_branch_point(config), - *config["expected_to_fail"], - ).splitlines() + changed_but_in_expected_to_fail = [] + if config["expected_to_fail"]: + debug("Expected to fail: %s", ", ".join(config["expected_to_fail"])) + + changed_but_in_expected_to_fail = git_diff( + "--name-only", + find_branch_point(config), + *config["expected_to_fail"], + ).splitlines() if check_only_reverts_from_branch_point(config, changed_but_in_expected_to_fail): return run_pytype_and_generate_summary(config)