Skip to content

Commit a6ed7d0

Browse files
committed
use cached pyenv to get python 3.8.1 for tool envs on travis
1 parent e811f33 commit a6ed7d0

File tree

3 files changed

+39
-16
lines changed

3 files changed

+39
-16
lines changed

.travis.yml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,38 @@ branches:
66
# 'v' followed by a digit, such as for version tags.
77
- master
88
- /^v\d.*$/
9-
cache: pip
9+
cache:
10+
pip: true
11+
directories:
12+
- $TRAVIS_BUILD_DIR/.pyenv
13+
addons:
14+
apt:
15+
packages:
16+
- make
17+
- build-essential
18+
- libssl-dev
19+
- zlib1g-dev
20+
- libbz2-dev
21+
- libreadline-dev
22+
- libsqlite3-dev
23+
- wget
24+
- curl
25+
- llvm
26+
- libncurses5-dev
27+
- libncursesw5-dev
28+
- xz-utils
29+
- tk-dev
30+
- libffi-dev
31+
- liblzma-dev
32+
- python-openssl
33+
- git
1034
env:
1135
global:
1236
- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
1337
- SEGFAULT_SIGNALS=all
38+
- DESERT_PYENV_ROOT=$TRAVIS_BUILD_DIR/.pyenv
39+
- TOXTOOLPYTHONVERSION=3.8.1
40+
- TOXTOOLPYTHON=${DESERT_PYENV_ROOT}/versions/${TOXTOOLPYTHONVERSION}/bin/python
1441
jobs:
1542
include:
1643
- python: '3.6'
@@ -33,23 +60,20 @@ before_install:
3360
- uname -a
3461
- lsb_release -a
3562
install:
63+
- |
64+
(
65+
if [[ ! -f ${TOXTOOLPYTHON} ]]; then
66+
export PYENV_ROOT="${DESERT_PYENV_ROOT}"
67+
rm -rf "${PYENV_ROOT}"
68+
curl https://pyenv.run | bash
69+
"${PYENV_ROOT}/bin/pyenv" install 3.8.1
70+
fi
71+
)
3672
- pip install tox
3773
- virtualenv --version
3874
- easy_install --version
3975
- pip --version
4076
- tox --version
41-
- |
42-
set -ex
43-
if [[ $TRAVIS_PYTHON_VERSION == 'pypy3' ]]; then
44-
(cd $HOME
45-
wget https://bitbucket.org/pypy/pypy/downloads/pypy3.6-v7.1.1-linux64.tar.bz2
46-
tar xf pypy3*.tar.bz2
47-
pypy3*/bin/pypy3 -m ensurepip
48-
pypy3*/bin/pypy3 -m pip install -U virtualenv)
49-
export PATH=$(echo $HOME/pypy3*/bin):$PATH
50-
export TOXPYTHON=$(echo $HOME/pypy3*/bin/pypy3)
51-
fi
52-
set +x starting
5377
- |
5478
set -ex
5579
if [[ $TOXENV == 'check' ]]; then

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ exclude = '''
4040
| \.hg
4141
| \.mypy_cache
4242
| \.tox
43+
| \.pyenv
4344
| \.?venv
4445
| _build
4546
| buck-out

tox.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ envlist =
1111
[testenv]
1212
basepython =
1313
pypy3: {env:TOXPYTHON:pypy3}
14-
{doc,spell}: {env:TOXPYTHON:python3.8}
1514
py36: {env:TOXPYTHON:python3.6}
1615
py37: {env:TOXPYTHON:python3.7}
1716
py38: {env:TOXPYTHON:python3.8}
18-
{bootstrap,clean,check,report,codecov}: {env:TOXPYTHON:python3}
17+
{doc,spell,bootstrap,clean,check,report,codecov}: {env:TOXTOOLPYTHON:python3.8}
1918
setenv =
2019
PYTHONPATH={toxinidir}/tests
2120
PYTHONUNBUFFERED=yes
@@ -56,7 +55,6 @@ deps =
5655
pyenchant
5756

5857
[testenv:doc]
59-
basepython=python3.8
6058
deps =
6159
-r{toxinidir}/docs/requirements.txt
6260

0 commit comments

Comments
 (0)