ansible-test - Ignore vendored code in mypy test.

pull/77976/head
Matt Clay 3 years ago
parent 6c6a7851ed
commit 11b6032e73

@ -60,9 +60,15 @@ class MypyTest(SanityMultipleVersion):
"""Sanity test which executes mypy.""" """Sanity test which executes mypy."""
ansible_only = True ansible_only = True
vendored_paths = (
'lib/ansible/module_utils/six/__init__.py',
'lib/ansible/module_utils/distro/_distro.py',
'lib/ansible/module_utils/compat/_selectors2.py',
)
def filter_targets(self, targets): # type: (t.List[TestTarget]) -> t.List[TestTarget] def filter_targets(self, targets): # type: (t.List[TestTarget]) -> t.List[TestTarget]
"""Return the given list of test targets, filtered to include only those relevant for the test.""" """Return the given list of test targets, filtered to include only those relevant for the test."""
return [target for target in targets if os.path.splitext(target.path)[1] == '.py' and ( return [target for target in targets if os.path.splitext(target.path)[1] == '.py' and target.path not in self.vendored_paths and (
target.path.startswith('lib/ansible/') or target.path.startswith('test/lib/ansible_test/_internal/') target.path.startswith('lib/ansible/') or target.path.startswith('test/lib/ansible_test/_internal/')
or target.path.startswith('test/lib/ansible_test/_util/target/sanity/import/'))] or target.path.startswith('test/lib/ansible_test/_util/target/sanity/import/'))]

@ -227,74 +227,3 @@ test/units/utils/collection_loader/fixtures/collections_masked/ansible_collectio
test/units/utils/collection_loader/fixtures/collections_masked/ansible_collections/testns/__init__.py empty-init # testing that collections don't need inits test/units/utils/collection_loader/fixtures/collections_masked/ansible_collections/testns/__init__.py empty-init # testing that collections don't need inits
test/units/utils/collection_loader/fixtures/collections_masked/ansible_collections/testns/testcoll/__init__.py empty-init # testing that collections don't need inits test/units/utils/collection_loader/fixtures/collections_masked/ansible_collections/testns/testcoll/__init__.py empty-init # testing that collections don't need inits
test/units/utils/collection_loader/test_collection_loader.py pylint:undefined-variable # magic runtime local var splatting test/units/utils/collection_loader/test_collection_loader.py pylint:undefined-variable # magic runtime local var splatting
lib/ansible/module_utils/six/__init__.py mypy-2.7:has-type # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.5:has-type # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.6:has-type # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.7:has-type # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.8:has-type # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.9:has-type # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.10:has-type # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.11:has-type # vendored code
lib/ansible/module_utils/six/__init__.py mypy-2.7:name-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.5:name-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.6:name-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.7:name-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.8:name-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.9:name-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.10:name-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.11:name-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-2.7:assignment # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.5:assignment # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.6:assignment # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.7:assignment # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.8:assignment # vendored code
lib/ansible/module_utils/six/__init__.py mypy-2.7:misc # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.5:misc # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.6:misc # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.7:misc # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.8:misc # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.9:misc # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.10:misc # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.11:misc # vendored code
lib/ansible/module_utils/six/__init__.py mypy-2.7:var-annotated # vendored code
lib/ansible/module_utils/six/__init__.py mypy-2.7:attr-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.5:var-annotated # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.5:attr-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.6:var-annotated # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.6:attr-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.7:var-annotated # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.7:attr-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.8:var-annotated # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.8:attr-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.9:var-annotated # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.9:attr-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.10:var-annotated # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.10:attr-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.11:var-annotated # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.11:attr-defined # vendored code
lib/ansible/module_utils/distro/_distro.py mypy-2.7:arg-type # vendored code
lib/ansible/module_utils/distro/_distro.py mypy-3.5:valid-type # vendored code
lib/ansible/module_utils/distro/_distro.py mypy-3.6:valid-type # vendored code
lib/ansible/module_utils/distro/_distro.py mypy-3.7:valid-type # vendored code
lib/ansible/module_utils/distro/_distro.py mypy-2.7:assignment # vendored code
lib/ansible/module_utils/distro/_distro.py mypy-2.7:attr-defined # vendored code
lib/ansible/module_utils/distro/_distro.py mypy-3.5:attr-defined # vendored code
lib/ansible/module_utils/distro/_distro.py mypy-3.6:attr-defined # vendored code
lib/ansible/module_utils/distro/_distro.py mypy-3.7:attr-defined # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-2.7:misc # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.5:misc # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.6:misc # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.7:misc # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.8:misc # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.9:misc # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.10:misc # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.11:misc # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-2.7:assignment # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.5:assignment # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.6:assignment # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.7:assignment # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.8:assignment # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.9:assignment # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.10:assignment # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.11:assignment # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-2.7:attr-defined # vendored code

Loading…
Cancel
Save