-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
289 lines (260 loc) · 9.48 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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
;
; Licensed to the Apache Software Foundation (ASF) under one or more
; contributor license agreements. See the NOTICE file distributed with
; this work for additional information regarding copyright ownership.
; The ASF licenses this file to You under the Apache License, Version 2.0
; (the "License"); you may not use this file except in compliance with
; the License. You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
[tox]
# new environments will be excluded by default unless explicitly added to envlist.
envlist = py36,py37,py38,py36-{cloud,cython},py37-{cloud,cython,lint,mypy},py38-{cloud,cython,docs,cloudcoverage},whitespacelint
toxworkdir = {toxinidir}/target/{env:ENV_NAME:.tox}
[pycodestyle]
# Disable all errors and warnings except for the ones related to blank lines.
# pylint does not check the number of blank lines.
select = E3
# Shared environment options.
[testenv]
# allow apps that support color to use it.
passenv=TERM
# Set [] options for pip installation of apache-beam tarball.
extras = test
# Don't warn that these commands aren't installed.
whitelist_externals =
false
time
bash
rm
deps =
cython: cython==0.28.1
-r build-requirements.txt
setenv =
RUN_SKIPPED_PY3_TESTS=0
# Use an isolated tmp dir for tests that get slowed down by scanning /tmp.
TMPDIR={envtmpdir}
# Silence warning about ignoring PYTHONPATH.
PYTHONPATH=
# These 2 magic command overrides are required for Jenkins builds.
# Otherwise we get "OSError: [Errno 2] No such file or directory" errors.
# Source:
# https://github.com/tox-dev/tox/issues/123#issuecomment-284714629
install_command = {envbindir}/python {envbindir}/pip install --retries 10 {opts} {packages}
list_dependencies_command = {envbindir}/python {envbindir}/pip freeze
commands_pre =
python --version
pip --version
pip check
bash {toxinidir}/scripts/run_tox_cleanup.sh
commands_post =
bash {toxinidir}/scripts/run_tox_cleanup.sh
commands = false {envname} is misconfigured
[testenv:py36]
commands =
python apache_beam/examples/complete/autocomplete_test.py
{toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
[testenv:py37]
commands =
python apache_beam/examples/complete/autocomplete_test.py
{toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
[testenv:py38]
commands =
python apache_beam/examples/complete/autocomplete_test.py
{toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
[testenv:py36-win]
commands =
python apache_beam/examples/complete/autocomplete_test.py
bash {toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
install_command = {envbindir}/python.exe {envbindir}/pip.exe install --retries 10 {opts} {packages}
list_dependencies_command = {envbindir}/python.exe {envbindir}/pip.exe freeze
[testenv:py37-win]
commands =
python apache_beam/examples/complete/autocomplete_test.py
bash {toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
install_command = {envbindir}/python.exe {envbindir}/pip.exe install --retries 10 {opts} {packages}
list_dependencies_command = {envbindir}/python.exe {envbindir}/pip.exe freeze
[testenv:py38-win]
commands =
python apache_beam/examples/complete/autocomplete_test.py
bash {toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
install_command = {envbindir}/python.exe {envbindir}/pip.exe install --retries 10 {opts} {packages}
list_dependencies_command = {envbindir}/python.exe {envbindir}/pip.exe freeze
[testenv:py36-cython]
# cython tests are only expected to work in linux (2.x and 3.x)
# If we want to add other platforms in the future, it should be:
# `platform = linux2|darwin|...`
# See https://docs.python.org/2/library/sys.html#sys.platform for platform codes
platform = linux
commands =
# TODO(BEAM-8954): Remove this build_ext invocation once local source no longer
# shadows the installed apache_beam.
python setup.py build_ext --inplace
python apache_beam/examples/complete/autocomplete_test.py
{toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
[testenv:py37-cython]
# cython tests are only expected to work in linux (2.x and 3.x)
# If we want to add other platforms in the future, it should be:
# `platform = linux2|darwin|...`
# See https://docs.python.org/2/library/sys.html#sys.platform for platform codes
platform = linux
commands =
# TODO(BEAM-8954): Remove this build_ext invocation once local source no longer
# shadows the installed apache_beam.
python setup.py build_ext --inplace
python apache_beam/examples/complete/autocomplete_test.py
{toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
[testenv:py38-cython]
# cython tests are only expected to work in linux (2.x and 3.x)
# If we want to add other platforms in the future, it should be:
# `platform = linux2|darwin|...`
# See https://docs.python.org/2/library/sys.html#sys.platform for platform codes
platform = linux
commands =
# TODO(BEAM-8954): Remove this build_ext invocation once local source no longer
# shadows the installed apache_beam.
python setup.py build_ext --inplace
python apache_beam/examples/complete/autocomplete_test.py
{toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
[testenv:py36-cloud]
extras = test,gcp,interactive,aws,azure
commands =
{toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
[testenv:py37-cloud]
extras = test,gcp,interactive,aws,azure
commands =
{toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
[testenv:py38-cloud]
extras = test,gcp,interactive,aws,azure
commands =
{toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
[testenv:py38-cloudcoverage]
# More recent versions of pytest-cov do not support pytest 4.4.0
deps =
codecov
pytest-cov==2.9.0
passenv = GIT_* BUILD_* ghprb* CHANGE_ID BRANCH_NAME JENKINS_* CODECOV_*
extras = test,gcp,interactive,aws
commands =
-rm .coverage
{toxinidir}/scripts/run_pytest.sh {envname} "{posargs}" "--cov-report=xml --cov=. --cov-append"
codecov
[testenv:py37-lint]
# Don't set TMPDIR to avoid "AF_UNIX path too long" errors in pylint.
setenv =
# keep the version of pylint in sync with the 'rev' in .pre-commit-config.yaml
deps =
-r build-requirements.txt
astroid<2.4,>=2.3.0
pycodestyle==2.3.1
pylint==2.4.3
isort==4.2.15
flake8==3.5.0
commands =
pylint --version
time {toxinidir}/scripts/run_pylint.sh
[testenv:whitespacelint]
setenv =
deps =
whitespacelint==1.1.0
commands =
time {toxinidir}/scripts/run_whitespacelint.sh
[testenv:py37-mypy]
deps =
-r build-requirements.txt
mypy==0.782
# make extras available in case any of these libs are typed
extras =
gcp
commands =
mypy --version
python setup.py mypy
[testenv:py38-docs]
extras = test,gcp,docs,interactive
deps =
Sphinx==3.0.3
sphinx_rtd_theme==0.4.3
commands =
time {toxinidir}/scripts/generate_pydoc.sh
[testenv:hdfs_integration_test]
# Used by hdfs_integration_test.sh. Do not run this directly, as it depends on
# nodes defined in hdfs_integration_test/docker-compose.yml.
deps =
-r build-requirements.txt
gsutil==4.47
holdup==1.8.0
extras =
gcp
whitelist_externals =
echo
sleep
passenv = HDFSCLI_CONFIG
commands =
holdup -t 45 http://namenode:50070 http://datanode:50075
echo "Waiting for safe mode to end."
sleep 45
gsutil cp gs://dataflow-samples/shakespeare/kinglear.txt .
hdfscli -v -v -v upload -f kinglear.txt /
python -m apache_beam.examples.wordcount \
--input hdfs://kinglear* \
--output hdfs://py-wordcount-integration \
--hdfs_host namenode --hdfs_port 50070 --hdfs_user root
python -m apache_beam.examples.wordcount \
--input hdfs://unused_server/kinglear* \
--output hdfs://unused_server/py-wordcount-integration \
--hdfs_host namenode --hdfs_port 50070 --hdfs_user root --hdfs_full_urls
# Disable pip check. TODO: remove this once gsutil does not conflict with
# apache_beam (oauth2client).
commands_pre =
[testenv:py3-yapf]
# keep the version of yapf in sync with the 'rev' in .pre-commit-config.yaml
deps =
yapf==0.29.0
commands =
yapf --version
time yapf --in-place --parallel --recursive apache_beam
[testenv:py3-yapf-check]
# keep the version of yapf in sync with the 'rev' in .pre-commit-config.yaml
deps =
yapf==0.29.0
commands =
yapf --version
time yapf --diff --parallel --recursive apache_beam
[testenv:py3-dependency-check]
# TODO(BEAM-10425): botocore, a part of [aws], wants docutils<0.16, but Sphinx
# pulls in the latest docutils. Uncomment this line once botocore does not
# conflict with Sphinx:
# extras = docs,test,gcp,aws,interactive,interactive_test
extras = test,gcp,aws,interactive,interactive_test
passenv = WORKSPACE
commands =
time {toxinidir}/scripts/run_dependency_check.sh
[testenv:jest]
setenv =
deps =
jupyterlab==2.2.5
commands =
time {toxinidir}/scripts/setup_nodejs.sh
time {toxinidir}/scripts/run_jest.sh
[testenv:eslint]
setenv =
deps =
jupyterlab==2.2.5
commands =
time {toxinidir}/scripts/setup_nodejs.sh
time {toxinidir}/scripts/run_eslint.sh
[testenv:flink-runner-test]
extras = test
commands =
{toxinidir}/scripts/pytest_validates_runner.sh {envname} {toxinidir}/apache_beam/runners/portability/flink_runner_test.py {posargs}
[testenv:spark-runner-test]
extras = test
commands =
{toxinidir}/scripts/pytest_validates_runner.sh {envname} {toxinidir}/apache_beam/runners/portability/spark_runner_test.py {posargs}