diff options
author | Matt Clay <matt@mystile.com> | 2023-02-20 17:55:04 -0800 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2023-03-14 17:49:52 -0700 |
commit | ef5842798d3bdf97d071202a7ec87a41b4dce223 (patch) | |
tree | ddb3a1a5183d5a8e38d3db73233a4aec1ffc6cb9 /test/lib | |
parent | 866d91bb7dbf6e089d34710d81326878a8ce3126 (diff) | |
download | ansible-ef5842798d3bdf97d071202a7ec87a41b4dce223.tar.gz |
[stable-2.13] ansible-test - Show Python version before install (#80022)
Always indicate the Python version being used before installing requirements.
(cherry picked from commit 5e3db6e44169aa88cd027f469eea96f1f17fea95)
Co-authored-by: Matt Clay <matt@mystile.com>
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/ansible_test/_internal/python_requirements.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/lib/ansible_test/_internal/python_requirements.py b/test/lib/ansible_test/_internal/python_requirements.py index 9086c7981c..d5247aa176 100644 --- a/test/lib/ansible_test/_internal/python_requirements.py +++ b/test/lib/ansible_test/_internal/python_requirements.py @@ -52,6 +52,7 @@ from .data import ( from .host_configs import ( PosixConfig, PythonConfig, + VirtualPythonConfig, ) from .connections import ( @@ -259,6 +260,20 @@ def run_pip( connection = connection or LocalConnection(args) script = prepare_pip_script(commands) + if isinstance(args, IntegrationConfig): + # Integration tests can involve two hosts (controller and target). + # The connection type can be used to disambiguate between the two. + context = " (controller)" if isinstance(connection, LocalConnection) else " (target)" + else: + context = "" + + if isinstance(python, VirtualPythonConfig): + context += " [venv]" + + # The interpreter path is not included below. + # It can be seen by running ansible-test with increased verbosity (showing all commands executed). + display.info(f'Installing requirements for Python {python.version}{context}') + if not args.explain: try: connection.run([python.path], data=script, capture=False) |