forked from trustin/sphinx-binary
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·55 lines (51 loc) · 1.55 KB
/
install.sh
File metadata and controls
executable file
·55 lines (51 loc) · 1.55 KB
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
#!/bin/bash -e
cd "$(dirname "$0")"
rm -fr build
# Install or find Python 3.6.
if [[ "$(uname)" =~ ([Ll]inux) ]]; then
if [[ "$TRAVIS_OS_NAME" == 'linux' ]]; then
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y python3.6 python3.6-venv python3.6-dev
fi
PYTHON=/usr/bin/python3.6
elif [[ "$(uname)" =~ ([Dd]arwin) ]]; then
if brew ls --versions python > /dev/null; then
brew upgrade python3
else
brew install python3
fi
PYTHON=/usr/local/bin/python3
elif [[ -n "$APPVEYOR" ]]; then
if [[ "$(./os_classifier.sh)" == 'windows-x86_32' ]]; then
PYTHON=/c/Python36/python
else
PYTHON=/c/Python36-x64/python
fi
else
echo "Unsupported build environment: $(uname -a)"
exit 1
fi
# Create and activate a Python 3.6 virtualenv.
echo "Creating a new virtualenv with $PYTHON"
"$PYTHON" -m venv build/venv
export PATH="$PWD/build/venv/bin:$PWD/build/venv/Scripts:$PATH"
# Upgrade pip and setuptools.
if [[ -n "$APPVEYOR" ]]; then
# Windows
python -m pip install --upgrade pip setuptools
else
pip install --upgrade pip setuptools
fi
# Make sure we use Python 3.6.
PYVER="$(python --version)"
PIPVER="$(pip --version)"
echo "$(which python) --version: $PYVER"
echo "$(which pip) --version: $PIPVER"
echo "os.classifier: $(./os_classifier.sh)"
if [[ ! "$PYVER" =~ (^Python 3\.6\.) ]] || \
[[ ! "$(which python)" =~ (^.*/build/venv/.*$) ]] || \
[[ ! "$PIPVER" =~ (^.*pip 10\..*[\\/]build[\\/]venv[\\/].*3\.6[^0-9].*$) ]]; then
echo 'Must run on Python 3.6 virtualenv with pip 10'
exit 1
fi