From 418b9b781d6514cfbbcc4a872020d53be1d9da69 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 7 Jan 2021 13:55:07 -0800 Subject: [PATCH] No longer warn about missing pip/python pair. This warning was intended to help improve test environment configuration. However, it has ended up producing mostly non-actionable warning noise instead. In most situations a missing pip or python should result in test failures. Reporting a missing pip also implies that it should be used by tests, which is not the case. Tests should be invoking pip as a python module with the appropriate python interpreter instead. --- .../fragments/ansible-test-python-pip-warnings.yml | 2 ++ test/lib/ansible_test/_internal/executor.py | 12 ++---------- 2 files changed, 4 insertions(+), 10 deletions(-) create mode 100644 changelogs/fragments/ansible-test-python-pip-warnings.yml diff --git a/changelogs/fragments/ansible-test-python-pip-warnings.yml b/changelogs/fragments/ansible-test-python-pip-warnings.yml new file mode 100644 index 00000000000..8acf6eb1dae --- /dev/null +++ b/changelogs/fragments/ansible-test-python-pip-warnings.yml @@ -0,0 +1,2 @@ +minor_changes: + - ansible-test - A warning is no longer emitted when a ``pip*`` or ``python*`` binary is found without a matching couterpart. diff --git a/test/lib/ansible_test/_internal/executor.py b/test/lib/ansible_test/_internal/executor.py index d5f857dfbe1..204a7189a59 100644 --- a/test/lib/ansible_test/_internal/executor.py +++ b/test/lib/ansible_test/_internal/executor.py @@ -2044,16 +2044,8 @@ class EnvironmentDescription: pip_path = pip_paths.get(version) python_path = python_paths.get(version) - if not python_path and not pip_path: - # neither python or pip is present for this version - return - - if not python_path: - warnings.append('A %s interpreter was not found, yet a matching pip was found at "%s".' % (python_label, pip_path)) - return - - if not pip_path: - warnings.append('A %s interpreter was found at "%s", yet a matching pip was not found.' % (python_label, python_path)) + if not python_path or not pip_path: + # skip checks when either python or pip are missing for this version return pip_shebang = pip_interpreters.get(version)