2017-03-19 02:26:31 +00:00
|
|
|
{% from "python_env/map.jinja" import python_env with context %}
|
|
|
|
|
2017-03-19 03:46:50 +00:00
|
|
|
{% if grains['travis'] == True and grains['kernel'] == 'Linux' %}
|
|
|
|
{% if "python2" in grains['pip'] %}
|
2017-03-19 04:11:40 +00:00
|
|
|
{% set pip_travis_env = '/opt/python/3.5.2/bin/pip3' %}
|
2017-03-19 03:46:50 +00:00
|
|
|
{% else %}
|
2017-03-19 04:11:40 +00:00
|
|
|
{% set pip_travis_env = grains['pip'] %}
|
2017-03-19 03:46:50 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
2017-03-19 02:21:08 +00:00
|
|
|
pip-install:
|
|
|
|
pkg.installed:
|
|
|
|
- name: {{ python_env.pip }}
|
|
|
|
|
|
|
|
virtualenv-install:
|
|
|
|
pip.installed:
|
|
|
|
- name: {{ python_env.virtualenv }}
|
|
|
|
- user: {{ grains.user }}
|
2017-03-19 04:11:40 +00:00
|
|
|
{% if grains['travis'] == True and grains['kernel'] == 'Linux' %}
|
2017-03-19 04:17:26 +00:00
|
|
|
- bin_env: {{ pip_travis_env }}
|
2017-03-19 04:11:40 +00:00
|
|
|
{% else %}
|
2017-03-19 02:21:08 +00:00
|
|
|
- bin_env: {{ python_env.pip_bin_env }}
|
2017-03-19 04:11:40 +00:00
|
|
|
{% endif %}
|
2017-03-19 02:21:08 +00:00
|
|
|
- require:
|
|
|
|
- pkg: pip-install
|
|
|
|
|
|
|
|
virtualenvwrapper-install:
|
|
|
|
pip.installed:
|
|
|
|
- name: {{ python_env.virtualenvwrapper }}
|
|
|
|
- user: {{ grains.user }}
|
2017-03-19 04:11:40 +00:00
|
|
|
{% if grains['travis'] == True and grains['kernel'] == 'Linux' %}
|
2017-03-19 04:17:26 +00:00
|
|
|
- bin_env: {{ pip_travis_env }}
|
2017-03-19 04:11:40 +00:00
|
|
|
{% else %}
|
2017-03-19 02:21:08 +00:00
|
|
|
- bin_env: {{ python_env.pip_bin_env }}
|
2017-03-19 04:11:40 +00:00
|
|
|
{% endif %}
|
2017-03-19 02:21:08 +00:00
|
|
|
- require:
|
|
|
|
- pip: virtualenv-install
|
|
|
|
|
|
|
|
zsh-virtualenvwrapper:
|
|
|
|
file.append:
|
|
|
|
- name: {{ grains.homedir }}/.zshrc
|
|
|
|
- text:
|
2017-03-19 03:46:50 +00:00
|
|
|
- "\n"
|
2017-03-19 02:21:08 +00:00
|
|
|
- "# Adding virtualenvwrapper python binary path"
|
|
|
|
- "export VIRTUALENVWRAPPER_PYTHON={{ python_env.python_path }}"
|
|
|
|
- ""
|
|
|
|
- "# Sourcing virtualenv"
|
|
|
|
- "source {{ grains.homedir }}/.local/bin/virtualenvwrapper.sh"
|