mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-08 14:02:38 +00:00
Add new AnsibleK8SModule class (#269)
* Add new AnsibleK8SModule class This class is intended to replace part of the K8SAnsibleMixin class and is part of a larger refactoring effort. * Fix sanity errors * Fix unit tests * Add mock to test requirements
This commit is contained in:
@@ -9,28 +9,36 @@ module_dir = target_dir / "plugins" / "modules"
|
||||
module_utils_dir = target_dir / "plugins" / "module_utils"
|
||||
ignore_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
skip_list = [
|
||||
skip_list_2_6 = [
|
||||
"compile-2.6!skip", # Py3.8+
|
||||
"import-2.6!skip", # Py3.8+
|
||||
]
|
||||
|
||||
skip_list_3 = [
|
||||
"compile-2.7!skip", # Py3.8+
|
||||
"compile-3.5!skip", # Py3.8+
|
||||
"import-2.6!skip", # Py3.8+
|
||||
"import-2.7!skip", # Py3.8+
|
||||
"import-3.5!skip", # Py3.8+
|
||||
"future-import-boilerplate!skip", # Py2 only
|
||||
"metaclass-boilerplate!skip", # Py2 only
|
||||
]
|
||||
|
||||
for version in ["2.9", "2.10", "2.11", "2.12"]:
|
||||
for version in ["2.9", "2.10", "2.11", "2.12", "2.13"]:
|
||||
ignore_file = ignore_dir / f"ignore-{version}.txt"
|
||||
ignore_content = ignore_file.read_text().split("\n")
|
||||
ignore_content.append(f"tests/sanity/refresh_ignore_files shebang!skip")
|
||||
|
||||
for f in module_dir.glob("*.py"):
|
||||
if version == "2.13":
|
||||
skip_list = skip_list_3
|
||||
else:
|
||||
skip_list = skip_list_2_6 + skip_list_3
|
||||
|
||||
for f in module_dir.glob("**/*.py"):
|
||||
if f.is_symlink():
|
||||
continue
|
||||
for test in skip_list:
|
||||
ignore_content.append(f"{f} {test}")
|
||||
for f in module_utils_dir.glob("*.py"):
|
||||
for f in module_utils_dir.glob("**/*.py"):
|
||||
if f.is_symlink():
|
||||
continue
|
||||
for test in skip_list:
|
||||
|
||||
Reference in New Issue
Block a user