Pip does not remove source code after successful build

I install Ansible from github using the Ansible pip module (clause 7.1.2 on Debian):

- pip: name: "git+https://github.com/ansible/ansible.git#egg=ansible" state: latest become: yes 

Then, on subsequent launches, I get a message:

fatal: [ansibletarget]: FAILED! => {"changed": false, "cmd": "/ usr / local / bin / pip install -U -e git + https://github.com/ansible/ansible.git#egg=ansible ", "failed ": true," msg ":" stdout: Retrieving information from git + https://github.com/ansible/ansible.git#egg=ansible \ n Update. / src / ansible clone \ n Full output from git reset --hard -q origin / master: \ n \ n ----------------- -------------------- --- \ n \ n: stderr: Could not find tag or branch 'origin / master', suggesting a commit. \ nfatal: ambiguous argument 'origin / master': unknown revision or path not in the working tree. \ nUse '-' to separate paths from revisions, for example: \ n 'git [...] - [...]' \ nCommand \ "git reset --hard -q origin / master \" failed with error code 128 in / tmp / src / ansible \ n "}

In /tmp/src I have ansible subdirectory along with pip-delete-this-directory.txt . However, Pip does not delete it.

The same behavior (downloaded, not deleted, error on subsequent calls) occurs with:

 pip install -U -e git+https://github.com/ansible/ansible.git#egg=ansible 

Basically, I want my game to be idempotent. I can delete the destination folder before installation and solve this problem, however, what is missing is that pip does not delete the contents, since its contents assume:

 This file is placed here by pip to indicate the source was put here by pip. Once this package is successfully installed this source code will be deleted (unless you remove this file). 
+5
source share

Source: https://habr.com/ru/post/1237574/


All Articles