1 |
commit: afe5f6320a174578f8aad50ad00ee1e37028334b |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 1 06:00:51 2018 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 1 08:38:04 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=afe5f632 |
7 |
|
8 |
.travis.yml: Take advantage of tox |
9 |
|
10 |
Replace the code responsible for installing dependencies and running |
11 |
tests on Travis to use tox. This reduces code duplication (= risk |
12 |
of mis-sync) and saves us from those hoops needed to install |
13 |
dependencies conditionally via travis. |
14 |
|
15 |
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org> |
16 |
Closes: https://github.com/gentoo/portage/pull/348 |
17 |
|
18 |
.travis.yml | 28 ++++++---------------------- |
19 |
1 file changed, 6 insertions(+), 22 deletions(-) |
20 |
|
21 |
diff --git a/.travis.yml b/.travis.yml |
22 |
index 9313fc645..846308e08 100644 |
23 |
--- a/.travis.yml |
24 |
+++ b/.travis.yml |
25 |
@@ -8,30 +8,14 @@ python: |
26 |
|
27 |
# command to install dependencies |
28 |
install: |
29 |
- - sudo apt-get update -qq |
30 |
- - sudo apt-get install -y libxml2-utils |
31 |
- - pip install lxml |
32 |
- # python3.6+ has sha3 built-in, for older versions install pysha3 |
33 |
- # (except for pypy where pysha3 is broken) |
34 |
- - "[[ ${TRAVIS_PYTHON_VERSION} == 3.[6789] || ${TRAVIS_PYTHON_VERSION} == pypy ]] || pip install pysha3" |
35 |
- # python3.6+ has blake2 built-in, for older versions install pyblake2 |
36 |
- - "[[ ${TRAVIS_PYTHON_VERSION} == 3.[6789] ]] || pip install pyblake2" |
37 |
- # always install pygost for Streebog |
38 |
- - pip install pygost |
39 |
- # pyyaml is needed for building |
40 |
- - pip install pyyaml |
41 |
+ - pip install tox |
42 |
|
43 |
script: |
44 |
- printf "[build_ext]\nportage-ext-modules=true" >> setup.cfg |
45 |
- ./setup.py test |
46 |
- ./setup.py install --root=/tmp/install-root |
47 |
- # prevent repoman tests from trying to fetch metadata.xsd |
48 |
- - mkdir -p /tmp/install-root/usr/lib/portage/cnf |
49 |
- - cp repoman/cnf/metadata.xsd /tmp/install-root/usr/lib/portage/cnf/ |
50 |
- - sudo rsync -a /tmp/install-root/. / |
51 |
- - python -b -Wd -m portage.tests.runTests |
52 |
- # repoman test block |
53 |
- - repoman/setup.py test |
54 |
- - repoman/setup.py install --root=/tmp/install-root |
55 |
- - sudo rsync -a /tmp/install-root/. / |
56 |
- - python -b -Wd -m repoman.tests.runTests |
57 |
+ - if [[ ${TRAVIS_PYTHON_VERSION} == ?.? ]]; then |
58 |
+ tox -e py${TRAVIS_PYTHON_VERSION/./}; |
59 |
+ else |
60 |
+ tox -e ${TRAVIS_PYTHON_VERSION}; |
61 |
+ fi |