forked from Mergifyio/mergify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
153 lines (139 loc) · 3.93 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
[tox]
envlist = py39,pep8
skipsdist = true
[testenv]
basepython = python3.9
passenv =
CI
setenv =
PYTHONASYNCIODEBUG=1
DD_DOGSTATSD_DISABLE=1
MERGIFYENGINE_TEST_SETTINGS=fake.env
MERGIFYENGINE_STORAGE_URL=redis://localhost:6363?db=2
MERGIFYENGINE_STREAM_URL=redis://localhost:6363?db=3
usedevelop = true
extras = test
install_command = pip install -c requirements.txt {opts} {packages}
commands = {toxinidir}/run-tests.sh pytest -v --pyargs mergify_engine {posargs}
[testenv:cover]
commands = {toxinidir}/run-tests.sh pytest -v --pyargs mergify_engine --cov=mergify_engine --cov-config .coveragerc {posargs}
[testenv:record]
envdir={toxworkdir}/py39
setenv =
MERGIFYENGINE_RECORD=1
DD_DOGSTATSD_DISABLE=1
MERGIFYENGINE_TEST_SETTINGS=test.env
MERGIFYENGINE_STORAGE_URL=redis://localhost:6363?db=2
MERGIFYENGINE_STREAM_URL=redis://localhost:6363?db=3
whitelist_externals =
git
commands =
{[testenv]commands}
git add zfixtures/cassettes/
[testenv:missing-imports]
extras =
commands = mergify-import-check
[testenv:test]
setenv =
PYTHONUNBUFFERED=1
DD_DOGSTATSD_DISABLE=1
MERGIFYENGINE_TEST_SETTINGS=test.env
MERGIFYENGINE_STORAGE_URL=redis://localhost:6363?db=2
MERGIFYENGINE_STREAM_URL=redis://localhost:6363?db=3
commands = {toxinidir}/run-tests.sh honcho -f Procfile-test start
[testenv:requirements]
recreate = true
extras =
commands = pip check
[testenv:genreqs]
recreate = true
skip_install = true
commands =
pip install -c requirements.txt -e .
pip uninstall --yes mergify-engine
bash -c "pip freeze --exclude-editable >| requirements.txt"
sed -i "/^aredis/d" requirements.txt
whitelist_externals =
bash
sed
[testenv:venv]
deps = .
commands = bash -c "{posargs}"
whitelist_externals = bash
[testenv:black]
skip_install = true
deps =
black
isort
commands =
isort .
black .
[testenv:pep8]
deps = flake8
flake8-black
flake8-blind-except
flake8-builtins
flake8-bugbear
flake8-use-fstring
flake8-docstrings
flake8-rst-docstrings
flake8-logging-format
flake8-comprehensions
isort
mypy
pytest
bandit
yamllint
whitelist_externals =
bash
commands =
flake8
isort -c .
mypy
bandit -r mergify_engine mergify_engine_signals -x mergify_engine/tests
yamllint .
bash tools/check-obsolete-fixtures.sh
[testenv:docs]
extras = docs
whitelist_externals =
rm
bash
mkdir
node
commands =
rm -rf docs/build
bash -c "git ls-files docs/*.rst | while read file; do if ! grep -q :description: $file; then echo E: no description meta tag in $file; exit 1; fi; done"
bash -c "cd docs && yarn && yarn build-bootstrap"
sphinx-build -q -W -b linkcheck docs/source docs/build
sphinx-build -W -b spelling docs/source docs/build
sphinx-build -W -b dirhtml docs/source docs/build
[testenv:test-docker]
setenv =
MERGIFYENGINE_STORAGE_URL=redis://localhost:6363?db=2
MERGIFYENGINE_STREAM_URL=redis://localhost:6363?db=3
whitelist_externals =
docker
commands =
docker build -t engine-dev .
./run-tests.sh docker run --rm --net=host --env-file test.env -e MERGIFYENGINE_STORAGE_URL={env:MERGIFYENGINE_STORAGE_URL} -e MERGIFYENGINE_STREAM_URL={env:MERGIFYENGINE_STREAM_URL} -e PORT=8802 -p 8802 engine-dev aio
[flake8]
exclude = .tox,.eggs,docs
show-source = true
select = A,C,E,F,W,B,B950
# E101,W191: Can't ignore tabs indent on multiline strings:
# https://gitlab.com/pycqa/flake8/issues/375
# E231 and E203 are not respected by black
# builtins:
# A003 allow builtin for class method/attribute
# bugbear:
# B950 is like E501, since we use black we don't care
# B306 is valid only for python 2 and safe for python 3
ignore = E501,W503,E203,G200,G201,E101,W191,E231,B902,B950,B306,A003
enable-extensions = G,FS003
[isort]
force_single_line = true
lines_after_imports = 2
force_sort_within_sections = true
known_first_party = mergify_engine,mergify_engine_signals
known_third_party = datadog
default_section = THIRDPARTY