Skip to content

Commit 986dbb7

Browse files
authored
Freeze upstream test requirements (#76)
Add: * upstream requirements freeze testenvs * frozen upstream requirements * upstream requirements tests
1 parent 954ce66 commit 986dbb7

5 files changed

+132
-0
lines changed

.travis.yml

+18
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ sudo: false
22
language: python
33
matrix:
44
include:
5+
# CPython 2.7
56
- python: 2.7
67
env: TOXENV=py27-local
78
- python: 2.7
@@ -10,6 +11,7 @@ matrix:
1011
env: TOXENV=py27-accept
1112
- python: 2.7
1213
env: TOXENV=py27-examples
14+
# CPython 3.4
1315
- python: 3.4
1416
env: TOXENV=py34-local
1517
- python: 3.4
@@ -18,6 +20,7 @@ matrix:
1820
env: TOXENV=py34-accept
1921
- python: 3.4
2022
env: TOXENV=py34-examples
23+
# CPython 3.5
2124
- python: 3.5
2225
env: TOXENV=py35-local
2326
- python: 3.5
@@ -26,6 +29,7 @@ matrix:
2629
env: TOXENV=py35-accept
2730
- python: 3.5
2831
env: TOXENV=py35-examples
32+
# CPython 3.6
2933
- python: 3.6
3034
env: TOXENV=py36-local
3135
- python: 3.6
@@ -34,6 +38,9 @@ matrix:
3438
env: TOXENV=py36-accept
3539
- python: 3.6
3640
env: TOXENV=py36-examples
41+
# CPython 3.7
42+
# xenial + sudo are currently needed to get 3.7
43+
# https://github.com/travis-ci/travis-ci/issues/9815
3744
- python: 3.7
3845
env: TOXENV=py37-local
3946
dist: xenial
@@ -50,10 +57,21 @@ matrix:
5057
env: TOXENV=py37-examples
5158
dist: xenial
5259
sudo: true
60+
# Upstream tests
5361
- python: 3.6
5462
env: TOXENV=nocmk
63+
- python: 2.7
64+
env: TOXENV=test-upstream-requirements-py27
65+
# xenial + sudo are currently needed to get 3.7
66+
# https://github.com/travis-ci/travis-ci/issues/9815
67+
- python: 3.7
68+
env: TOXENV=test-upstream-requirements-py37
69+
dist: xenial
70+
sudo: true
71+
# Security
5572
- python: 3.6
5673
env: TOXENV=bandit
74+
# Linting and autoformatting
5775
- python: 3.6
5876
env: TOXENV=doc8
5977
- python: 3.6

test/freeze-upstream-requirements.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
# Minimal wrapper script for upstream requirements install and freeze.
3+
# We do this here rather than as tox commands because tox does not support output redirection.
4+
if [ -z ${1} ]; then
5+
exit 1
6+
fi
7+
8+
pip install -r requirements.txt
9+
pip install -r test/requirements.txt
10+
pip freeze > ${1}

test/upstream-requirements-py27.txt

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
asn1crypto==0.24.0
2+
atomicwrites==1.2.1
3+
attrs==18.1.0
4+
boto3==1.8.4
5+
botocore==1.11.4
6+
cffi==1.11.5
7+
coverage==4.5.1
8+
cryptography==2.3.1
9+
docutils==0.14
10+
enum34==1.1.6
11+
funcsigs==1.0.2
12+
futures==3.2.0
13+
idna==2.7
14+
ipaddress==1.0.22
15+
jmespath==0.9.3
16+
mock==2.0.0
17+
more-itertools==4.3.0
18+
pathlib2==2.3.2
19+
pbr==4.2.0
20+
pluggy==0.7.1
21+
py==1.6.0
22+
pycparser==2.18
23+
pytest==3.7.4
24+
pytest-cov==2.5.1
25+
pytest-mock==1.10.0
26+
python-dateutil==2.7.3
27+
s3transfer==0.1.13
28+
scandir==1.9.0
29+
six==1.11.0
30+
urllib3==1.23
31+
wrapt==1.10.11

test/upstream-requirements-py37.txt

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
asn1crypto==0.24.0
2+
atomicwrites==1.2.1
3+
attrs==18.1.0
4+
boto3==1.8.4
5+
botocore==1.11.4
6+
cffi==1.11.5
7+
coverage==4.5.1
8+
cryptography==2.3.1
9+
docutils==0.14
10+
idna==2.7
11+
jmespath==0.9.3
12+
mock==2.0.0
13+
more-itertools==4.3.0
14+
pbr==4.2.0
15+
pluggy==0.7.1
16+
py==1.6.0
17+
pycparser==2.18
18+
pytest==3.7.4
19+
pytest-cov==2.5.1
20+
pytest-mock==1.10.0
21+
python-dateutil==2.7.3
22+
s3transfer==0.1.13
23+
six==1.11.0
24+
urllib3==1.23
25+
wrapt==1.10.11

tox.ini

+48
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,54 @@ sitepackages = False
6262
deps = -rtest/requirements.txt
6363
commands = {[testenv:base-command]commands} test/ -m local
6464

65+
# Collect requirements for use in upstream tests
66+
[testenv:freeze-upstream-requirements-base]
67+
sitepackages = False
68+
skip_install = True
69+
recreate = True
70+
deps =
71+
commands = {toxinidir}/test/freeze-upstream-requirements.sh
72+
73+
# Freeze for Python 2.7
74+
[testenv:freeze-upstream-requirements-py27]
75+
basepython = python2.7
76+
sitepackages = {[testenv:freeze-upstream-requirements-base]sitepackages}
77+
skip_install = {[testenv:freeze-upstream-requirements-base]skip_install}
78+
recreate = {[testenv:freeze-upstream-requirements-base]recreate}
79+
deps = {[testenv:freeze-upstream-requirements-base]deps}
80+
commands = {[testenv:freeze-upstream-requirements-base]commands} test/upstream-requirements-py27.txt
81+
82+
# Freeze for Python 3.7
83+
[testenv:freeze-upstream-requirements-py37]
84+
basepython = python3.7
85+
sitepackages = {[testenv:freeze-upstream-requirements-base]sitepackages}
86+
skip_install = {[testenv:freeze-upstream-requirements-base]skip_install}
87+
recreate = {[testenv:freeze-upstream-requirements-base]recreate}
88+
deps = {[testenv:freeze-upstream-requirements-base]deps}
89+
commands = {[testenv:freeze-upstream-requirements-base]commands} test/upstream-requirements-py37.txt
90+
91+
# Test frozen upstream requirements
92+
[testenv:test-upstream-requirements-base]
93+
sitepackages = False
94+
recreate = True
95+
commands = {[testenv:base-command]commands} test/ -m local
96+
97+
# Test frozen upstream requirements for Python 2.7
98+
[testenv:test-upstream-requirements-py27]
99+
basepython = python2.7
100+
deps = -rtest/upstream-requirements-py27.txt
101+
sitepackages = {[testenv:test-upstream-requirements-base]sitepackages}
102+
recreate = {[testenv:test-upstream-requirements-base]recreate}
103+
commands = {[testenv:test-upstream-requirements-base]commands}
104+
105+
# Test frozen upstream requirements for Python 3.7
106+
[testenv:test-upstream-requirements-py37]
107+
basepython = python3.7
108+
deps = -rtest/upstream-requirements-py37.txt
109+
sitepackages = {[testenv:test-upstream-requirements-base]sitepackages}
110+
recreate = {[testenv:test-upstream-requirements-base]recreate}
111+
commands = {[testenv:test-upstream-requirements-base]commands}
112+
65113
# Linters
66114
[testenv:flake8]
67115
basepython = python3

0 commit comments

Comments
 (0)