2015-12-12 17:56:05 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
if [[ "$(uname -s)" == 'Darwin' ]]; then
|
2016-04-11 01:51:12 +01:00
|
|
|
# install pyenv from the git repo (quicker than using brew)
|
|
|
|
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
|
|
|
|
PYENV_ROOT="$HOME/.pyenv"
|
|
|
|
PATH="$PYENV_ROOT/bin:$PATH"
|
|
|
|
eval "$(pyenv init -)"
|
2015-12-12 17:56:05 +00:00
|
|
|
|
|
|
|
case "${TOXENV}" in
|
|
|
|
py27)
|
2016-04-11 01:51:12 +01:00
|
|
|
# install pip on the system python
|
2015-12-12 17:56:05 +00:00
|
|
|
curl -O https://bootstrap.pypa.io/get-pip.py
|
|
|
|
python get-pip.py --user
|
|
|
|
;;
|
|
|
|
py33)
|
|
|
|
pyenv install 3.3.6
|
|
|
|
pyenv global 3.3.6
|
|
|
|
;;
|
|
|
|
py34)
|
|
|
|
pyenv install 3.4.3
|
|
|
|
pyenv global 3.4.3
|
|
|
|
;;
|
|
|
|
py35)
|
2016-04-11 01:51:12 +01:00
|
|
|
pyenv install 3.5.1
|
|
|
|
pyenv global 3.5.1
|
2015-12-12 17:56:05 +00:00
|
|
|
;;
|
|
|
|
pypy)
|
2016-04-08 22:04:28 +01:00
|
|
|
pyenv install pypy-5.0.0
|
|
|
|
pyenv global pypy-5.0.0
|
2015-12-12 17:56:05 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
pyenv rehash
|
2016-04-11 01:51:12 +01:00
|
|
|
python -m pip install --user --upgrade pip virtualenv
|
2015-12-12 17:56:05 +00:00
|
|
|
else
|
2016-04-13 21:47:32 +01:00
|
|
|
# on Linux, we only need pyenv to get the latest pypy and jython
|
|
|
|
if [[ "${TOXENV}" == "pypy" || "${TOXENV}" == "jython" ]]; then
|
2015-12-12 17:56:05 +00:00
|
|
|
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
|
|
|
|
PYENV_ROOT="$HOME/.pyenv"
|
|
|
|
PATH="$PYENV_ROOT/bin:$PATH"
|
|
|
|
eval "$(pyenv init -)"
|
2016-04-13 21:47:32 +01:00
|
|
|
|
|
|
|
if [[ "${TOXENV}" == "pypy" ]]; then
|
|
|
|
pyenv install pypy-5.0.0
|
|
|
|
pyenv global pypy-5.0.0
|
|
|
|
else
|
travis: try using jython 2.7.1b2; don't install from requirements.txt on Jython to avoid RuntimeError
I don't know why but when I `pip install -r requirements.txt` on Jython,
it always raises a Java StackOverflowError.
If I install the deps individually, it works...
$ pip install -v -r dev-requirements.txt
Exception:
Traceback (most recent call last):
File "fonttools-jy271b2/Lib/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "fonttools-jy271b2/Lib/site-packages/pip/commands/install.py", line 285, in run
self.populate_requirement_set(
File "fonttools-jy271b2/Lib/site-packages/pip/basecommand.py", line 286, in populate_requirement_set
for req in parse_requirements(
File "fonttools-jy271b2/Lib/site-packages/pip/req/req_file.py", line 89, in parse_requirements
for line_number, line in lines_enum:
File "fonttools-jy271b2/Lib/site-packages/pip/req/req_file.py", line 323, in ignore_comments
for line_number, line in lines_enum:
File "fonttools-jy271b2/Lib/site-packages/pip/req/req_file.py", line 298, in join_lines
if COMMENT_RE.match(line):
RuntimeError: maximum recursion depth exceeded (Java StackOverflowError)
2016-04-15 08:38:49 +01:00
|
|
|
pyenv install jython-2.7.1b2
|
|
|
|
pyenv global jython-2.7.1b2
|
2016-04-13 21:47:32 +01:00
|
|
|
fi
|
2016-04-11 01:51:12 +01:00
|
|
|
pyenv rehash
|
2015-12-12 17:56:05 +00:00
|
|
|
fi
|
2016-04-11 01:51:12 +01:00
|
|
|
pip install --upgrade pip virtualenv
|
2015-12-12 17:56:05 +00:00
|
|
|
fi
|
|
|
|
|
2016-04-11 01:51:12 +01:00
|
|
|
# activate virtualenv and install test requirements
|
2015-12-12 17:56:05 +00:00
|
|
|
python -m virtualenv ~/.venv
|
|
|
|
source ~/.venv/bin/activate
|
travis: try using jython 2.7.1b2; don't install from requirements.txt on Jython to avoid RuntimeError
I don't know why but when I `pip install -r requirements.txt` on Jython,
it always raises a Java StackOverflowError.
If I install the deps individually, it works...
$ pip install -v -r dev-requirements.txt
Exception:
Traceback (most recent call last):
File "fonttools-jy271b2/Lib/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "fonttools-jy271b2/Lib/site-packages/pip/commands/install.py", line 285, in run
self.populate_requirement_set(
File "fonttools-jy271b2/Lib/site-packages/pip/basecommand.py", line 286, in populate_requirement_set
for req in parse_requirements(
File "fonttools-jy271b2/Lib/site-packages/pip/req/req_file.py", line 89, in parse_requirements
for line_number, line in lines_enum:
File "fonttools-jy271b2/Lib/site-packages/pip/req/req_file.py", line 323, in ignore_comments
for line_number, line in lines_enum:
File "fonttools-jy271b2/Lib/site-packages/pip/req/req_file.py", line 298, in join_lines
if COMMENT_RE.match(line):
RuntimeError: maximum recursion depth exceeded (Java StackOverflowError)
2016-04-15 08:38:49 +01:00
|
|
|
|
|
|
|
if [[ "${TOXENV}" == "jython" ]]; then
|
|
|
|
# using requirements.txt with pip on Jython raises `RuntimeError:
|
|
|
|
# maximum recursion depth exceeded (Java StackOverflowError)`
|
|
|
|
pip install pytest
|
|
|
|
else
|
|
|
|
pip install -r dev-requirements.txt
|
|
|
|
fi
|