diff options
author | Matt Clay <mclay@redhat.com> | 2020-12-15 19:27:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-15 19:27:32 +0100 |
commit | 37d09f24882c1f03be9900e610d53587cfa6bbd6 (patch) | |
tree | 160920f10047a09f4f11bff33868f9709423a8c2 /test/lib | |
parent | Remove note on combining roles and collections (#72957) (diff) | |
download | ansible-37d09f24882c1f03be9900e610d53587cfa6bbd6.tar.xz ansible-37d09f24882c1f03be9900e610d53587cfa6bbd6.zip |
Update ansible-test pylint Python support. (#72972)
* Update ansible-test pylint Python support.
* Python 3.8 is now officially supported.
* Python 3.9 is now skipped with a warning.
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/ansible_test/_data/requirements/constraints.txt | 6 | ||||
-rw-r--r-- | test/lib/ansible_test/_data/requirements/sanity.pylint.txt | 2 | ||||
-rw-r--r-- | test/lib/ansible_test/_internal/sanity/pylint.py | 8 |
3 files changed, 12 insertions, 4 deletions
diff --git a/test/lib/ansible_test/_data/requirements/constraints.txt b/test/lib/ansible_test/_data/requirements/constraints.txt index 58044f2cc2..1c335c1002 100644 --- a/test/lib/ansible_test/_data/requirements/constraints.txt +++ b/test/lib/ansible_test/_data/requirements/constraints.txt @@ -53,12 +53,12 @@ antsibull-changelog == 0.7.0 antsibull >= 0.21.0 # freeze pylint and its requirements for consistent test results -astroid == 2.2.5 +astroid == 2.3.3 isort == 4.3.15 -lazy-object-proxy == 1.3.1 +lazy-object-proxy == 1.4.3 mccabe == 0.6.1 pylint == 2.3.1 -typed-ast == 1.4.0 # 1.4.0 is required to compile on Python 3.8 +typed-ast == 1.4.1 wrapt == 1.11.1 # freeze pycodestyle for consistent test results diff --git a/test/lib/ansible_test/_data/requirements/sanity.pylint.txt b/test/lib/ansible_test/_data/requirements/sanity.pylint.txt index 1b800bd060..438ca51dad 100644 --- a/test/lib/ansible_test/_data/requirements/sanity.pylint.txt +++ b/test/lib/ansible_test/_data/requirements/sanity.pylint.txt @@ -1,3 +1,3 @@ -pylint ; python_version < '3.9' # installation fails on python 3.9.0b1 +pylint pyyaml # needed for collection_detail.py mccabe # pylint complexity testing diff --git a/test/lib/ansible_test/_internal/sanity/pylint.py b/test/lib/ansible_test/_internal/sanity/pylint.py index 769a171728..324e587346 100644 --- a/test/lib/ansible_test/_internal/sanity/pylint.py +++ b/test/lib/ansible_test/_internal/sanity/pylint.py @@ -64,6 +64,14 @@ class PylintTest(SanitySingleVersion): """Error code for ansible-test matching the format used by the underlying test program, or None if the program does not use error codes.""" return 'ansible-test' + @property + def supported_python_versions(self): # type: () -> t.Optional[t.Tuple[str, ...]] + """A tuple of supported Python versions or None if the test does not depend on specific Python versions.""" + # Python 3.9 is not supported on pylint < 2.5.0. + # Unfortunately pylint 2.5.0 and later include an unfixed regression. + # See: https://github.com/PyCQA/pylint/issues/3701 + return tuple(python_version for python_version in super(PylintTest, self).supported_python_versions if python_version not in ('3.9',)) + 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 [target for target in targets if os.path.splitext(target.path)[1] == '.py' or is_subdir(target.path, 'bin')] |