Remove the pip workaround for Ubuntu Trusty from the python-env role. It must go into a dedicated role.

This commit is contained in:
Andrea Dell'Amico 2018-07-25 12:22:17 +02:00
parent bdd0b47a1f
commit d2a7454b22
4 changed files with 9 additions and 62 deletions

View File

@ -2,22 +2,7 @@
py_env_install: False
py_env_pkgs_state: present
py_env_site: False
py_env_trusty_workaround: True
py_env_get_pip_url: https://bootstrap.pypa.io/get-pip.py
py_env_basic_pkgs:
- python-pip
py_env_pip_dev_packages:
- libpython-dev
- libssl-dev
- libffi-dev
py_env_pip_fix_ssl_warnings:
- pyOpenSSL
- cryptography
- idna
- certifi
- ndg-httpsclient
- pyasn1

View File

@ -1,7 +0,0 @@
#!/bin/bash
GET_PIP=/usr/local/lib/get-pip.py
chmod 755 $GET_PIP
$GET_PIP

3
python-env/meta/main.yml Normal file
View File

@ -0,0 +1,3 @@
---
dependencies:
- { role: '../../library/roles/ubuntu-python-setup', when: python_pip_env_workaround is not defined }

View File

@ -4,6 +4,12 @@
apt: name={{ item }} state={{ py_env_pkgs_state }} update_cache=yes cache_valid_time=600
with_items: '{{ py_env_basic_pkgs | default([]) }}'
when:
- py_env_install
- python_pip_env_workaround is not defined
tags: [ "python", "py_env" ]
- block:
- name: Install python deb packages
apt: name={{ item }} state={{ py_env_pkgs_state }} update_cache=yes cache_valid_time=600
with_items: '{{ py_env_dpkg | default([]) }}'
@ -12,45 +18,6 @@
apt: name={{ item }} state={{ py_env_pkgs_state }} update_cache=yes cache_valid_time=600
with_items: '{{ py_pip_deps | default([]) }}'
when: py_env_install
tags: [ "python", "py_env" ]
- block:
- name: Install the get-pip.py pip downloader
get_url: url={{ py_env_get_pip_url }} dest=/usr/local/lib/get-pip.py
- name: Install a script that fixes the broken trusty pip package
copy: src=pip-fixer.sh dest=/usr/local/bin/python-pip-fixer mode=0755 owner=root group=root
register: python_pip_fixer
- name: Fix the trusty pip installation
shell: /usr/local/bin/python-pip-fixer
when: python_pip_fixer is changed
- name: Install the python dev headers and other dev requirements
apt: pkg={{ item }} state=present
with_items: '{{ py_env_pip_dev_packages }}'
- name: Install a specific version of tornado to avoid breaking dependencies
pip: name=tornado version=4.1 state=present
- name: Install the latest six python package
pip: name=six state=present
- name: Install setuptools version 33.1.1
pip: name=setuptools version=33.1.1 state=present
when:
- py_env_trusty_workaround
- py_env_install
- is_trusty
tags: [ "python", "py_env" ]
- block:
- name: Fix the ssl warnings installing some ssl libraries
pip: name={{ item }}
with_items: '{{ py_env_pip_fix_ssl_warnings | default ([]) }}'
- name: Install a list of pip packages
pip: name={{ item }} state=latest
with_items: '{{ py_env_pip_pkgs | default ([]) }}'
@ -61,5 +28,4 @@
when:
- py_env_install
- is_trusty
tags: [ "python", "py_env", "py_env_pkgs" ]