diff --git a/changelogs/fragments/81522_unable_to_find_pip_in_virutalenv_with_relative_path.yml b/changelogs/fragments/81522_unable_to_find_pip_in_virutalenv_with_relative_path.yml new file mode 100644 index 00000000000..a427afbb487 --- /dev/null +++ b/changelogs/fragments/81522_unable_to_find_pip_in_virutalenv_with_relative_path.yml @@ -0,0 +1,2 @@ +bugfixes: + - fix unable to find pip in the virtualenv when using relative path \ No newline at end of file diff --git a/test/integration/targets/pip/tasks/pip.yml b/test/integration/targets/pip/tasks/pip.yml index 9f1034d29a9..000ba97f47c 100644 --- a/test/integration/targets/pip/tasks/pip.yml +++ b/test/integration/targets/pip/tasks/pip.yml @@ -621,3 +621,17 @@ - pip_prereleases is successful - pip_prereleases is not changed - '"fallible==0.0.1a2" in pip_prereleases.stdout_lines' + +#https://github.com/ansible/ansible/issues/81522 +- name: Unable to find pip in the virtualenv when using relative path + pip: + chdir: checkout-dir # a relative path + requirements: "{{ remote_tmp_dir}}/pipreq.txt" #we dont care about what we are trying to install here + virtualenv: venv + virtualenv_command: python3 -m venv + register: pip_output # Registering the output of the pip task + +- assert: + that: + - pip_output is successful + - '"checkout-dir/venv" in pip_output.virtualenv'