Skip to content

Commit

Permalink
pytype_reporter: cleanup config to test files migrated to python3
Browse files Browse the repository at this point in the history
Signed-off-by: Bernhard Kaindl <[email protected]>
  • Loading branch information
bernhardkaindl committed Mar 8, 2024
1 parent ecef664 commit c5df3c4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 61 deletions.
58 changes: 4 additions & 54 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <file> 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 = ""
16 changes: 9 additions & 7 deletions pytype_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c5df3c4

Please sign in to comment.