Skip to content
Snippets Groups Projects
Verified Commit d77a3268 authored by Newbyte's avatar Newbyte :snowflake:
Browse files

mrtest: Ignore attr-defined for mrtest-module functions

mypy cannot find these as they're defined in __init__.py:

$ mypy mrtest.py mrhlpr.py --check-untyped-defs
mrtest/zap_packages.py:36: error: Module has no attribute "is_root_user"  [attr-defined]
mrtest/zap_packages.py:37: error: Module has no attribute "get_sudo"  [attr-defined]
mrtest/add_packages.py:60: error: Module has no attribute "get_virtual_group"  [attr-defined]
mrtest/add_packages.py:63: error: Module has no attribute "is_root_user"  [attr-defined]
mrtest/add_packages.py:64: error: Module has no attribute "get_sudo"  [attr-defined]
parent 7635a662
No related branches found
No related tags found
No related merge requests found
......@@ -57,11 +57,11 @@ def run_apk_add(origin, mr_id, apk_paths):
"add",
"-u",
"--virtual",
mrtest.get_virtual_group(origin, mr_id),
mrtest.get_virtual_group(origin, mr_id), # type: ignore[attr-defined]
"--allow-untrusted",
] + apk_paths
if not mrtest.is_root_user():
cmd = [mrtest.get_sudo()] + cmd
if not mrtest.is_root_user(): # type: ignore[attr-defined]
cmd = [mrtest.get_sudo()] + cmd # type: ignore[attr-defined]
print("Installing packages...")
logging.debug(f"+ {cmd}")
......
......@@ -33,8 +33,8 @@ def remove_virtual():
exit(1)
cmd = ["apk", "del"] + virtual
if not mrtest.is_root_user():
cmd = [mrtest.get_sudo()] + cmd
if not mrtest.is_root_user(): # type: ignore[attr-defined]
cmd = [mrtest.get_sudo()] + cmd # type: ignore[attr-defined]
print("Removing packages...")
logging.debug(f"+ {cmd}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment