]> git.phdru.name Git - ansible.git/blob - playbooks/roles/python-packages/tasks/main.yml
Feat(python-packages): Install `auditwheel`
[ansible.git] / playbooks / roles / python-packages / tasks / main.yml
1 - name: Install Python and packages (Debian)
2   become: true
3   apt:
4     autoclean: yes
5     autoremove: yes
6     cache_valid_time: 3600
7     install_recommends: no
8     name: ['patchelf', # for auditwheel
9            'python', 'python2.7', 'python3', 'python-pip', 'python3-pip',
10            'python-setuptools', 'python3-setuptools',
11            'python-gdbm', 'python-openssl', 'python3-openssl',
12           ]
13     state: latest
14     update_cache: yes
15   register: python
16   when: ansible_facts.os_family == 'Debian'
17
18 - name: Install Python and packages (RedHat)
19   become: true
20   dnf:
21     name: ['python2', 'python3', 'python2-pip', 'python3-pip',
22            'python2-setuptools', 'python3-setuptools',
23            'python2-pyOpenSSL', 'python3-pyOpenSSL',
24           ]
25     state: latest
26     update_cache: yes
27   register: python
28   when: ansible_facts.os_family == 'RedHat'
29
30 - name: Upgrade Python packages
31   become: true
32   shell: 'umask 022; exec {{ item }} -m pip install --compile --upgrade
33       "pip<19.1" setuptools tox virtualenv virtualenvwrapper
34       flake8 sphinx twine'
35   when: python.changed
36   loop: ['python3', 'python2']
37
38 - name: Install wheel for Python2
39   become: true
40   shell: 'umask 022; exec python2 -m pip install --compile --upgrade
41       "wheel==0.31.1"'
42   when: python.changed
43
44 - name: Install wheel and auditwheel for Python3
45   become: true
46   shell: 'umask 022; exec python3 -m pip install --compile --upgrade
47       "wheel==0.34.1" "auditwheel==3.1.0"'
48   when: python.changed