This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
forked from apache/libcloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
230 lines (210 loc) · 7.98 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
[tox]
envlist = py{pypy3.5,3.5,3.6,3.7,3.8},checks,lint,pylint,mypy,docs,coverage
skipsdist = true
[testenv]
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
deps =
-r{toxinidir}/requirements-tests.txt
lockfile
libvirt-python==5.9.0
setuptools==42.0.2
basepython =
pypypy3.5: pypy3.5
pypypy3: pypy3
py3.5: python3.5
py3.6: python3.6
{py3.7,docs,checks,lint,pylint,mypy,coverage,docs,py3.7-dist,py3.7-dist-wheel}: python3.7
{py3.8,py3.8-windows}: python3.8
commands = cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
python setup.py test
whitelist_externals = cp
bash
scripts/*.sh
[testenv:py3.8-windows]
deps =
-r{toxinidir}/requirements-tests.txt
lockfile
setuptools==42.0.2
[testenv:py3.7-dist]
# Verify library installs without any dependencies when using python setup.py
# install
skipdist = True
recreate = True
# NOTE: We intentionally set empty deps to ensure it works on a clean
# environment without any dependencies
deps =
# Ensure those packages are not installed. If they are, it indicates unclean
# environment so those checks won't work correctly
commands = bash -c "pip show requests && exit 1 || exit 0"
bash -c "pip show typing && exit 1 || exit 0"
bash -c "pip show enum34 && exit 1 || exit 0"
bash -c "pip show apache-libcloud || exit 0"
python setup.py install
pip show apache-libcloud
# Verify all dependencies were installed
pip show requests
bash -c "pip show typing && exit 1 || exit 0"
bash -c "pip show enum34 && exit 1 || exit 0"
[testenv:py3.7-dist-wheel]
# Verify library installs without any dependencies when using built wheel
skipdist = True
recreate = True
# NOTE: We intentionally set empty deps to ensure it works on a clean
# environment without any dependencies
deps =
# Ensure those packages are not installed. If they are, it indicates unclean
# environment so those checks won't work correctly
commands = bash -c "pip show requests && exit 1 || exit 0"
bash -c "pip show typing && exit 1 || exit 0"
bash -c "pip show enum34 && exit 1 || exit 0"
bash -c "pip show apache-libcloud || exit 0"
bash -c "rm -rf dist/apache_libcloud-*.whl"
pip install wheel
python setup.py bdist_wheel
bash -c "pip install dist/apache_libcloud-*.whl"
# Verify all dependencies were installed
pip show requests
bash -c "pip show typing && exit 1 || exit 0"
bash -c "pip show enum34 && exit 1 || exit 0"
[testenv:docs]
deps = pyopenssl
lockfile
rstcheck
changedir = docs
commands = pip install sphinx~=1.6.0
rstcheck --report warning ../CHANGES.rst
python ../contrib/generate_provider_feature_matrix_table.py
sphinx-apidoc -d 4 ../libcloud/ -o apidocs/
/bin/bash -c "ls apidocs/modules.rst && (grep orphan apidocs/modules.rst || sed -i '1i :orphan:\n' apidocs/modules.rst) || (exit 0)"
sphinx-build -W -b html -d {envtmpdir}/doctrees . _build/html
[testenv:docs-travis]
# Note: We don't build API docs on Travis since it causes build failures because
# those API docs files are not included anywhere.
deps = pyopenssl
lockfile
rstcheck
changedir = docs
commands = pip install sphinx~=1.6.0
rstcheck --report warning ../README.rst
rstcheck --report warning ../CHANGES.rst
rstcheck --report warning ../CONTRIBUTING.rst
python ../contrib/generate_provider_feature_matrix_table.py
/bin/bash -c "ls apidocs/modules.rst && (grep orphan apidocs/modules.rst || sed -i '1i :orphan:\n' apidocs/modules.rst) || (exit 0)"
sphinx-build -W -b html -d {envtmpdir}/doctrees . _build/html
[testenv:provider-tables]
basepython: python3.7
deps = typing
pyopenssl
lockfile
rstcheck
requests
commands = python ./contrib/generate_provider_feature_matrix_table.py
[testenv:scrape-and-publish-provider-prices]
basepython: python3.7
deps = requests
demjson
setenv =
PYTHONPATH={toxinidir}
passenv = GCE_API_KEY PRICING_DATA_BUCKET_NAME AWS_REGION AWS_ACCESS_KEY_ID AWS_ACCESS_KEY_SECRET
commands =
python contrib/scrape-gce-prices.py --all
python contrib/scrape-gce-prices.py
python contrib/upload-pricing-data-to-s3.py libcloud/data/pricing.json
[testenv:scrape-provider-prices]
basepython: python3.7
deps = requests
demjson
passenv = GCE_API_KEY
commands =
python contrib/scrape-gce-prices.py --all
python contrib/scrape-gce-prices.py
#python contrib/scrape-ec2-prices.py
[testenv:scrape-ec2-prices]
basepython: python3.7
deps = requests
demjson
commands = python contrib/scrape-ec2-prices.py
[testenv:scrape-ec2-sizes]
basepython: python3.7
deps = requests
ijson
commands = bash -c 'python contrib/scrape-ec2-sizes.py > libcloud/compute/constants.py'
[testenv:pylint]
deps = -r{toxinidir}/requirements-tests.txt
bottle
lockfile
paramiko==2.7.1
pysphere
setenv =
PYTHONPATH={toxinidir}
commands = pylint -E --load-plugins=pylint_plugins.driver_class --rcfile=./.pylintrc libcloud/common/
pylint -E --load-plugins=pylint_plugins.driver_class --rcfile=./.pylintrc libcloud/compute/
pylint -E --load-plugins=pylint_plugins.driver_class --rcfile=./.pylintrc libcloud/container/
pylint -E --load-plugins=pylint_plugins.driver_class --rcfile=./.pylintrc libcloud/backup/
pylint -E --load-plugins=pylint_plugins.driver_class --rcfile=./.pylintrc libcloud/dns/
pylint -E --load-plugins=pylint_plugins.driver_class --rcfile=./.pylintrc libcloud/storage/
pylint -E --load-plugins=pylint_plugins.driver_class --rcfile=./.pylintrc libcloud/utils/
pylint -E --load-plugins=pylint_plugins.driver_class --rcfile=./.pylintrc demos/
pylint -E --load-plugins=pylint_plugins.driver_class --rcfile=./.pylintrc contrib/
pylint -E --load-plugins=pylint_plugins.driver_class --rcfile=./.pylintrc pylint_plugins/
[testenv:lint]
deps = -r{toxinidir}/requirements-tests.txt
lockfile
rstcheck
commands = flake8 libcloud/
flake8 --max-line-length=160 libcloud/test/
flake8 demos/
flake8 integration/
flake8 scripts/
flake8 --ignore=E402,E902,W503,W504 docs/examples/
flake8 --ignore=E402,E902,W503,W504 --max-line-length=160 contrib/
python -mjson.tool libcloud/data/pricing.json /dev/null
rstcheck --report warning README.rst
rstcheck --report warning CHANGES.rst
rstcheck --report warning CONTRIBUTING.rst
[testenv:checks]
commands =
bash ./scripts/check_file_names.sh
python ./scripts/check_asf_license_headers.py .
[testenv:integration]
deps = -r{toxinidir}/integration/requirements.txt
commands = python -m integration
[testenv:coverage]
deps =
-r{toxinidir}/requirements-tests.txt
setuptools==42.0.2
paramiko==2.7.1
pyopenssl
python-dateutil
libvirt-python==5.9.0
lockfile
set-env =
commands = cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
coverage run --source=libcloud setup.py test
[testenv:coverage-travis]
passenv = TOXENV CI TRAVIS TRAVIS_*
deps =
-r{toxinidir}/requirements-tests.txt
paramiko==2.7.1
pyopenssl
libvirt-python==5.9.0
lockfile
set-env =
commands = cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
coverage run --source=libcloud setup.py test
codecov
[testenv:mypy]
deps =
setuptools==42.0.2
typing
mypy==0.740
commands =
mypy --no-incremental libcloud/common/
mypy --no-incremental libcloud/compute/
mypy --no-incremental libcloud/storage/
mypy --no-incremental libcloud/dns/
mypy --no-incremental libcloud/container/
mypy --no-incremental example_compute.py
mypy --no-incremental example_storage.py
mypy --no-incremental example_dns.py
mypy --no-incremental example_container.py