aboutsummaryrefslogtreecommitdiffstats
path: root/.travis/install.sh
blob: fafc4cada4b36eeb0317942c37a36a96353219bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash

set -e
set -x

if [[ "$(uname -s)" == 'Darwin' ]]; then
    DARWIN=true
else
    DARWIN=false
fi

if [[ "${OPENSSL}" == "0.9.8" ]]; then
    if [[ "$DARWIN" = true ]]; then
        # travis has openssl installed via brew already, but let's be sure
        if [[ "$(brew list | grep openssl)" != "openssl" ]]; then
            brew install openssl
        fi
    else
        sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ lucid main"
        sudo apt-get -y update
        sudo apt-get install -y --force-yes libssl-dev/lucid
    fi
fi

if [[ "${TOX_ENV}" == "docs" ]]; then
    if [[ "$DARWIN" = true ]]; then
        brew update
        brew install enchant
    else
        sudo apt-get -y update
        sudo apt-get install libenchant-dev
    fi
fi

if [[ "$DARWIN" = true ]]; then
    if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
    case "${TOX_ENV}" in
        py26)
            curl -O https://bootstrap.pypa.io/get-pip.py
            sudo python get-pip.py
            sudo pip install virtualenv
            ;;
        py27)
            curl -O https://bootstrap.pypa.io/get-pip.py
            sudo python get-pip.py
            sudo pip install virtualenv
            ;;
        pypy)
            pyenv install pypy-2.3.1
            pyenv global pypy-2.3.1
            pip install virtualenv
            ;;
        py32)
            pyenv install 3.2.5
            pyenv global 3.2.5
            pip install virtualenv
            ;;
        py33)
            pyenv install 3.3.5
            pyenv global 3.3.5
            pip install virtualenv
            ;;
        py34)
            pyenv install 3.4.1
            pyenv global 3.4.1
            pip install virtualenv
            ;;
        docs)
            curl -O https://bootstrap.pypa.io/get-pip.py
            sudo python get-pip.py
            sudo pip install virtualenv
            ;;
    esac
    pyenv rehash
else
    # add mega-python ppa
    sudo add-apt-repository -y ppa:fkrull/deadsnakes
    sudo apt-get -y update

    case "${TOX_ENV}" in
        py26)
            sudo apt-get install python2.6 python2.6-dev
            ;;
        py32)
            sudo apt-get install python3.2 python3.2-dev
            ;;
        py33)
            sudo apt-get install python3.3 python3.3-dev
            ;;
        py34)
            sudo apt-get install python3.4 python3.4-dev
            ;;
        py3pep8)
            sudo apt-get install python3.3 python3.3-dev
            ;;
        pypy)
            sudo add-apt-repository -y ppa:pypy/ppa
            sudo apt-get -y update
            sudo apt-get install -y --force-yes pypy pypy-dev
            ;;
    esac
    sudo pip install virtualenv
fi

virtualenv ~/.venv
source ~/.venv/bin/activate
pip install tox coveralls

if [[ "$DARWIN" = true ]]; then
    pyenv rehash
fi