Skip to content

Commit 20abc82

Browse files
jovialmarkgoddard
andauthored
Fix travis (#10)
* Use py3 for tox by default, use train UC for python <= 3.5 Upstream OpenStack has dropped support for python 2, and even python 3.5. This means that master upper constraints no longer install on these versions. * Test with python 3.8 * Test with python3.6 and python3.7 3.8 isn't a supported runtime for OpenStack until Victoria. Train and Ussuri support 3.6-3.7. * Workaround for python3.8 * Whitespace fix Co-authored-by: Mark Goddard <[email protected]>
1 parent d8286d8 commit 20abc82

File tree

3 files changed

+53
-11
lines changed

3 files changed

+53
-11
lines changed

.travis.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
language: python
3-
python: "2.7"
43

54
# Run jobs in containers.
65
sudo: false
@@ -14,16 +13,26 @@ addons:
1413
- realpath
1514

1615
# Create a build matrix for the different test jobs.
17-
env:
18-
matrix:
19-
# Run python style checks.
20-
- TOX_ENV=pep8
16+
matrix:
17+
include:
2118
# Run python2.7 unit tests.
22-
- TOX_ENV=py27
19+
- python: 2.7
20+
env: TOXENV=py27
21+
# Run python style checks.
22+
- python: 3.8
23+
env: TOXENV=pep8
24+
# Run python3.6 unit tests.
25+
- python: 3.6
26+
env: TOXENV=py36
27+
# Run python3.7 unit tests.
28+
- python: 3.7
29+
env: TOXENV=py37
30+
# Run python3.8 unit tests.
31+
- python: 3.8
32+
env: TOXENV=py38
2333

2434
install:
2535
- pip install tox
2636

2737
script:
28-
# Run the tox environment.
29-
- tox -e ${TOX_ENV}
38+
- tox

test-requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# The order of packages is significant, because pip processes them in the order
22
# of appearance. Changing the order has an impact on the overall integration
33
# process, which may cause wedges in the gate later.
4+
pyflakes>=2.2.0 # MIT
5+
python-ironicclient # Apache-2.0
46
coverage!=4.4,>=4.0 # Apache-2.0
57
flake8-import-order==0.11 # LGPLv3
68
hacking<0.13,>=0.12.0 # Apache-2.0

tox.ini

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
[tox]
2-
envlist = py35,py27,pep8
2+
envlist = py36,py37,py38,py27,pep8
33

44
[testenv]
55
usedevelop = True
6-
install_command = pip install -U -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
6+
install_command = pip install -U {opts} {packages}
7+
basepython = python3.8
78
deps =
9+
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
10+
-r{toxinidir}/requirements.txt
811
-r{toxinidir}/test-requirements.txt
912
commands =
1013
coverage run --branch --include "stackhpc_inspector_plugins*" -m unittest discover stackhpc_inspector_plugins.tests.unit
@@ -22,10 +25,38 @@ commands =
2225
coverage report -m
2326

2427
[testenv:pep8]
25-
basepython = python2.7
2628
commands =
2729
flake8 stackhpc_inspector_plugins
2830

31+
[testenv:py27]
32+
basepython = python2.7
33+
deps =
34+
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/train}
35+
-r{toxinidir}/requirements.txt
36+
-r{toxinidir}/test-requirements.txt
37+
38+
[testenv:py38]
39+
basepython = python3.8
40+
# FIXME: Use ussuri release until victoria is released.
41+
deps =
42+
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/ussuri}
43+
-r{toxinidir}/requirements.txt
44+
-r{toxinidir}/test-requirements.txt
45+
46+
[testenv:py37]
47+
basepython = python3.7
48+
deps =
49+
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/ussuri}
50+
-r{toxinidir}/requirements.txt
51+
-r{toxinidir}/test-requirements.txt
52+
53+
[testenv:py36]
54+
basepython = python3.6
55+
deps =
56+
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/train}
57+
-r{toxinidir}/requirements.txt
58+
-r{toxinidir}/test-requirements.txt
59+
2960
[flake8]
3061
max-complexity=15
3162
# [H106] Don’t put vim configuration in source files.

0 commit comments

Comments
 (0)