Sha256: 74771652d3788942c1540e801efea856d0366f087a7bd295620140b6dc4bd512

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

#! /bin/bash

# Create the python environment needed by run-tests.py and closure-linter and
# other Python tools.

OLD_PWD=$PWD

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd $DIR
if [ ! -f bin/activate ]; then
  echo "Setting up Python environment in $DIR"

  if [ x$(which pip) == x -o x$(which virtualenv) == x ]; then
    cat <<EOF
Can not autoinstall as pip and virtualenv are not avaliable.

To install 'pip' please do one of the following;

# sudo apt-get install python-pip python-virtualenv

or

# sudo easy_install pip
# sudo pip install virtualenv
EOF
    exit 1
  fi

  if virtualenv --system-site-packages .; then
    echo -e;
  else
   cat <<EOF
Was unable to set up the virtualenv environment. Please see output for errors.
EOF
    exit 1
  fi
fi

source bin/activate

function ensureRequirementsMet() {
  # Check if installed
  pip install --no-download $@ > /dev/null 2>&1
  if [ $? -ne 0 ]; then
    # Install dependencies
    pip install --upgrade $@
    if [ $? -ne 0 ]; then
      cat <<EOF
Unable to install dependencies. Please see error output above.
EOF
      exit 1
    fi
  fi
}

ensureRequirementsMet 'pip>=1.5'
ensureRequirementsMet -r requirements.txt

cd $OLD_PWD

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
polymer-paper-rails-0.2.0 app/assets/components/web-animations-js/tools/python/setup.sh
polymer-core-rails-0.2.0 app/assets/components/web-animations-js/tools/python/setup.sh