diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b6bdad376ae9d301e2d04c7fcae7b8eba8ce93c4..e0e8d66298544ba5fde2a388857b88923d4b98e4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,8 +4,8 @@ on: - push - pull_request jobs: - check_docs_29: - name: Check Ansible Documentation with Ansible 2.9. + check_docs_oldest_supported: + name: Check Ansible Documentation with ansible-core 2.12. runs-on: ubuntu-latest steps: - uses: actions/checkout@v3.1.0 @@ -14,15 +14,15 @@ jobs: - uses: actions/setup-python@v4.3.0 with: python-version: '3.x' - - name: Install Ansible 2.9 + - name: Install Ansible 2.12 run: | - python -m pip install "ansible < 2.10" + python -m pip install "ansible-core >=2.12,<2.13" - name: Run ansible-doc-test run: | ANSIBLE_LIBRARY="." ANSIBLE_DOC_FRAGMENT_PLUGINS="." python utils/ansible-doc-test -v roles plugins - check_docs_2_11: - name: Check Ansible Documentation with ansible-core 2.11. + check_docs_previous: + name: Check Ansible Documentation with ansible-core 2.13. runs-on: ubuntu-latest steps: - uses: actions/checkout@v3.1.0 @@ -31,15 +31,15 @@ jobs: - uses: actions/setup-python@v4.3.0 with: python-version: '3.x' - - name: Install Ansible 2.11 + - name: Install Ansible 2.13 run: | - python -m pip install "ansible-core >=2.11,<2.12" + python -m pip install "ansible-core >=2.13,<2.14" - name: Run ansible-doc-test run: | ANSIBLE_LIBRARY="." ANSIBLE_DOC_FRAGMENT_PLUGINS="." python utils/ansible-doc-test -v roles plugins - check_docs_2_12: - name: Check Ansible Documentation with ansible-core 2.12. + check_docs_current: + name: Check Ansible Documentation with ansible-core 2.14. runs-on: ubuntu-latest steps: - uses: actions/checkout@v3.1.0 @@ -48,15 +48,14 @@ jobs: - uses: actions/setup-python@v4.3.0 with: python-version: '3.x' - - name: Install Ansible 2.12 + - name: Install Ansible 2.14 run: | - python -m pip install "ansible-core >=2.12,<2.13" + python -m pip install "ansible-core >=2.14,<2.15" - name: Run ansible-doc-test run: | - python -m pip install "ansible-core >=2.12,<2.13" ANSIBLE_LIBRARY="." ANSIBLE_DOC_FRAGMENT_PLUGINS="." python utils/ansible-doc-test -v roles plugins - check_docs_latest: + check_docs_ansible_latest: name: Check Ansible Documentation with latest Ansible version. runs-on: ubuntu-latest steps: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 303b74191e551d207e611fd5f2623fc549322bca..08d94083f9e005d8e195fd1f1ab962f810ba104e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,7 @@ jobs: python-version: "3.x" - name: Run ansible-lint run: | - pip install ansible-core==2.11.6 ansible-lint + pip install "ansible-core >=2.14,<2.15" ansible-lint find playbooks roles tests -name '*.yml' ! -name "env_*" ! -name "tasks_*" -exec ansible-lint --force-color {} \+ env: ANSIBLE_MODULE_UTILS: plugins/module_utils @@ -34,7 +34,7 @@ jobs: with: python-version: "3.x" - name: Run yaml-lint - uses: ibiqlik/action-yamllint@v1 + uses: ibiqlik/action-yamllint@v3.1.1 pydocstyle: name: Verify pydocstyle @@ -63,7 +63,7 @@ jobs: python-version: "3.x" - name: Run flake8 run: | - pip install flake8 + pip install flake8 flake8-bugbear flake8 pylint: @@ -78,7 +78,7 @@ jobs: python-version: "3.x" - name: Run pylint run: | - pip install pylint==2.13.7 wrapt==1.14.0 + pip install pylint==2.14.4 wrapt==1.14.0 pylint plugins roles --disable=import-error shellcheck: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index da62f85fc7ef16e66a4a01e151c5945ff2cfe32e..3c1417ae9fcc73e430c49841f0f3428ecc3350f9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/ansible/ansible-lint.git - rev: v5.3.2 + rev: v6.6.1 hooks: - id: ansible-lint always_run: false @@ -11,20 +11,20 @@ repos: entry: | env ANSIBLE_LIBRARY=./plugins/modules ANSIBLE_MODULE_UTILS=./plugins/module_utils ANSIBLE_DOC_FRAGMENT_PLUGINS=./plugins/doc_fragments ansible-lint - repo: https://github.com/adrienverge/yamllint.git - rev: v1.26.1 + rev: v1.28.0 hooks: - id: yamllint files: \.(yaml|yml)$ - repo: https://github.com/pycqa/flake8 - rev: 3.9.2 + rev: 5.0.3 hooks: - id: flake8 - repo: https://github.com/pycqa/pydocstyle - rev: 6.1.1 + rev: 6.0.0 hooks: - id: pydocstyle - repo: https://github.com/pycqa/pylint - rev: v2.12.2 + rev: v2.14.4 hooks: - id: pylint args: diff --git a/plugins/module_utils/ansible_freeipa_module.py b/plugins/module_utils/ansible_freeipa_module.py index b71c78c98a4bc03b41770dae89e8197931844c70..ff7b06dc353c4c105e57171a2ecd48c2531d1ddf 100644 --- a/plugins/module_utils/ansible_freeipa_module.py +++ b/plugins/module_utils/ansible_freeipa_module.py @@ -1125,8 +1125,8 @@ class IPAAnsibleModule(AnsibleModule): def ipa_get_domain(self): """Retrieve IPA API domain.""" if not hasattr(self, "__ipa_api_domain"): - setattr(self, "__ipa_api_domain", api_get_domain()) - return getattr(self, "__ipa_api_domain") + setattr(self, "__ipa_api_domain", api_get_domain()) # noqa: B010 + return getattr(self, "__ipa_api_domain") # noqa: B009 @staticmethod def ipa_get_realm(): diff --git a/plugins/modules/ipaautomountmap.py b/plugins/modules/ipaautomountmap.py index 14d06dd1de561bb2eab1ca643de4df4f89d24861..1590ebb69518366b476cc13599a04ccb8f475c19 100644 --- a/plugins/modules/ipaautomountmap.py +++ b/plugins/modules/ipaautomountmap.py @@ -126,7 +126,7 @@ class AutomountMap(IPAAnsibleModule): self.params_fail_used_invalid(invalid, state) - def get_args(self, mapname, desc): # pylint: disable=no-self-use + def get_args(self, mapname, desc): # automountmapname is required for all automountmap operations. if not mapname: self.fail_json(msg="automountmapname cannot be None or empty.") diff --git a/plugins/modules/ipadnszone.py b/plugins/modules/ipadnszone.py index 0c34003385bd0464d08508ead15a01eb634796bd..a44e8cfb83687a0f7adfe6bdfbdac9d7d981eb96 100644 --- a/plugins/modules/ipadnszone.py +++ b/plugins/modules/ipadnszone.py @@ -280,7 +280,8 @@ class DNSZoneModule(IPAAnsibleModule): if any(invalid_ips): self.fail_json(msg=error_msg % invalid_ips) - def is_valid_nsec3param_rec(self, nsec3param_rec): # pylint: disable=R0201 + @staticmethod + def is_valid_nsec3param_rec(nsec3param_rec): try: part1, part2, part3, part4 = nsec3param_rec.split(" ") except ValueError: diff --git a/requirements-dev.txt b/requirements-dev.txt index 0915965a4d3a2675e45c0ca95135fb9d3448c19f..f7fa4419e0891b7fd3be52ddbaccd7453464f7e5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,10 +1,10 @@ -r requirements-tests.txt ipdb==0.13.4 -pre-commit -flake8==4.0.1 +pre-commit==2.20.0 +flake8==5.0.3 flake8-bugbear==22.10.27 -pylint==2.13.7 -wrapt >= 1.14.0 +pylint==2.14.4 +wrapt == 1.14.0 pydocstyle==6.0.0 -yamllint==1.26.3 -ansible-lint==5.3.2 +yamllint==1.28.0 +ansible-lint==6.6.1 diff --git a/requirements-tests.txt b/requirements-tests.txt index 292e81c6dcea1c81f8b0dd16334c784f06c2c6bd..e6f74d6484debbccced6c56f90f70f038053e690 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,7 +1,8 @@ -r requirements.txt -pytest>=2.7 -pytest-sourceorder>=0.5 +pytest==7.1.3 +pytest-sourceorder==0.6.0 pytest-split>=0.8.0 pytest-custom_exit_code>=0.3.0 -pytest-testinfra>=5.0 +pytest-testinfra==6.8.0 +pytest-randomly==3.12.0 pyyaml>=3 diff --git a/utils/get_test_modules.py b/utils/get_test_modules.py index 1e7518c52d77b1798142f63a9ff7ded01d264c22..cb20e0d65eebe1cdebffb4543391829b69bd0366 100644 --- a/utils/get_test_modules.py +++ b/utils/get_test_modules.py @@ -84,7 +84,7 @@ def get_plugins_from_playbook(playbook): def import_mock(name, *args): """Intercept 'import' calls and store module name.""" if not hasattr(import_mock, "call_list"): - setattr(import_mock, "call_list", set()) + setattr(import_mock, "call_list", set()) # noqa: B010 import_mock.call_list.add(name) # pylint: disable=no-member try: # print("NAME:", name)