Skip to content

Commit 32a4e45

Browse files
committed
[travis] Install tox/coveralls dependencies only in travis's lint stage
Because we only need those dependencies for our `tox` tests so we may speed up a little the overall CI tests timings. We also remove all the other apt commands performed in `before_install` because we don't need it. Note: in order to successfully pass the test `test_pythonpackage_basic.test_virtualenv`, we need to deactivate the system virtualenv See also: travis-ci/travis-ci#8589
1 parent d2ff49d commit 32a4e45

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.travis.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ services:
1212
- docker
1313

1414
before_install:
15-
- travis_retry sudo apt update -qq
16-
# to successfully send the coveralls reports we need pyOpenSSL
17-
- travis_retry sudo apt install -qq --no-install-recommends
18-
python2.7 python3 python3-venv python3-virtualenv python3-pip
19-
python3-setuptools python3-openssl
20-
# (venv/virtualenv are both used by tests/test_pythonpackage.py)
21-
- sudo pip install tox>=2.0
22-
- sudo pip3 install coveralls
2315
# https://github.com/travis-ci/travis-ci/issues/6069#issuecomment-266546552
2416
- git remote set-branches --add origin master
2517
- git fetch
@@ -35,6 +27,19 @@ jobs:
3527
name: "Tox tests and coverage"
3628
language: python
3729
python: 3.7
30+
before_script:
31+
# We need to escape virtualenv for `test_pythonpackage_basic.test_virtualenv`
32+
# See also: https://github.com/travis-ci/travis-ci/issues/8589
33+
- type -t deactivate && deactivate || true
34+
- export PATH=/opt/python/3.7/bin:$PATH
35+
# Install tox & virtualenv
36+
# Note: venv/virtualenv are both used by tests/test_pythonpackage.py
37+
- pip3.7 install -U virtualenv
38+
- pip3.7 install tox>=2.0
39+
# Install coveralls & dependencies
40+
# Note: pyOpenSSL needed to send the coveralls reports
41+
- pip3.7 install pyOpenSSL
42+
- pip3.7 install coveralls
3843
script:
3944
# we want to fail fast on tox errors without having to `docker build` first
4045
- tox -- tests/ --ignore tests/test_pythonpackage.py

0 commit comments

Comments
 (0)