Skip to content

Instantly share code, notes, and snippets.

@jbub
Created January 25, 2014 13:16
Show Gist options
  • Save jbub/8616240 to your computer and use it in GitHub Desktop.
Save jbub/8616240 to your computer and use it in GitHub Desktop.
Install newest pip, setuptools, virtualenv with your python app dependencies.
download_pip:
cmd.run:
- name: "curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py"
- cwd: /tmp
- unless: "test -f /tmp/get-pip.py"
- require:
- pkg: curl
install_pip:
cmd.run:
- name: "python get-pip.py"
- cwd: /tmp
- reload_modules: true
- require:
- cmd: download_pip
install_virtualenv:
pip.installed:
- name: virtualenv
- require:
- cmd: install_pip
create_virtualenv:
virtualenv.managed:
- name: app
- system_site_packages: False
- require:
- pip: install_virtualenv
install_app_packages:
pip.installed:
- requirements: path/to/app/requirements.txt
- bin_env: path/to/virtualenvs/app
- require:
- virtualenv: create_virtualenv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment