-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathtox.ini
More file actions
209 lines (185 loc) · 5.05 KB
/
tox.ini
File metadata and controls
209 lines (185 loc) · 5.05 KB
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
[tox]
envlist =
# The performance tests only work for python 3.11 and 3.12
py{311,312}-performance_tests-mpl
bandit, doc8
; {flake8, pylint}{,-tests},
isort-check, black-check,
# prone to false positives
vulture
# Additional test environments:
#
# linters :: Runs all linters over all source code.
# linters-tests :: Runs all linters over all tests.
# Autoformatter helper environments:
#
# autoformat : Apply all autoformatters
#
# black-check : Check for "black" issues
# blacken : Fix all "black" issues
#
# isort-seed : Generate a known_third_party list for isort.
# NOTE: make the "known_third_party = " line in setup.cfg before running this
# NOTE: currently it incorrectly identifies this library too; make sure you remove it
# isort-check : Check for isort issues
# isort : Fix isort issues
# Operational helper environments:
#
# build :: Builds source and wheel dist files.
# test-release :: Builds dist files and uploads to testpypi pypirc profile.
# release :: Builds dist files and uploads to pypi pypirc profile.
[testenv:base-command]
commands = pytest test/
deps =
click
[testenv]
passenv =
# Pass through AWS credentials
AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN \
# AWS Role access in CodeBuild is via the contaner URI
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI \
# Pass through AWS profile name (useful for local testing)
AWS_PROFILE
sitepackages = False
deps =
-rrequirements.txt
# Install the MPL requirements if the `-mpl` suffix is present
mpl: -rrequirements_mpl.txt
..
commands =
performance_tests: {[testenv:base-command]commands}
[testenv:blacken-src]
basepython = python3
deps = -r../dev_requirements/linter-requirements.txt
commands =
black --line-length 120 \
src/aws_encryption_sdk_performance_tests/ \
setup.py \
test/ \
{posargs}
# Linters
[testenv:flake8]
basepython = python3
deps = -r../dev_requirements/linter-requirements.txt
commands =
flake8 \
src/aws_encryption_sdk_performance_tests/ \
setup.py \
{posargs}
[testenv:flake8-tests]
basepython = {[testenv:flake8]basepython}
deps = -r../dev_requirements/linter-requirements.txt
commands =
flake8 \
# Ignore F811 redefinition errors in tests (breaks with pytest-mock use)
# E203 is not PEP8 compliant https://github.com/ambv/black#slices
# W503 is not PEP8 compliant https://github.com/ambv/black#line-breaks--binary-operators
--ignore F811,E203,W503,D \
test/
[testenv:pylint]
basepython = python3
deps =
-r../dev_requirements/linter-requirements.txt
commands =
pylint \
--rcfile=pylintrc \
src/aws_encryption_sdk_performance_tests/ \
setup.py \
{posargs}
[testenv:pylint-tests]
basepython = {[testenv:pylint]basepython}
deps = {[testenv:pylint]deps}
commands =
pylint \
--rcfile=pylintrc \
test/ \
{posargs}
[testenv:blacken]
basepython = python3
deps =
{[testenv:blacken-src]deps}
commands =
{[testenv:blacken-src]commands}
[testenv:black-check]
basepython = python3
deps =
{[testenv:blacken]deps}
commands =
{[testenv:blacken-src]commands} --diff
[testenv:isort-seed]
basepython = python3
deps = -r../dev_requirements/linter-requirements.txt
commands = seed-isort-config
[testenv:isort]
basepython = python3
deps = -r../dev_requirements/linter-requirements.txt
commands = isort -rc \
src \
test \
setup.py \
{posargs}
[testenv:isort-check]
basepython = python3
deps = {[testenv:isort]deps}
commands = {[testenv:isort]commands} -c
[testenv:autoformat]
basepython = python3
deps =
{[testenv:blacken]deps}
{[testenv:isort]deps}
..
commands =
{[testenv:blacken]commands}
{[testenv:isort]commands}
[testenv:doc8]
basepython = python3
deps = -r../dev_requirements/linter-requirements.txt
commands = doc8 README.rst
[testenv:readme]
basepython = python3
deps = -r../dev_requirements/linter-requirements.txt
commands = python setup.py check -r -s
[testenv:bandit]
basepython = python3
deps = -r../dev_requirements/linter-requirements.txt
commands = bandit -r src/aws_encryption_sdk_performance_tests/
[testenv:linters]
basepython = python3
deps =
{[testenv:flake8]deps}
{[testenv:pylint]deps}
{[testenv:doc8]deps}
{[testenv:readme]deps}
{[testenv:bandit]deps}
commands =
{[testenv:flake8]commands}
{[testenv:pylint]commands}
{[testenv:doc8]commands}
{[testenv:readme]commands}
{[testenv:bandit]commands}
# Release tooling
[testenv:build]
basepython = python3
skip_install = true
deps =
-r../dev_requirements/release-requirements.txt
commands =
python setup.py sdist bdist_wheel
[testenv:test-release]
basepython = python3
skip_install = true
deps =
{[testenv:build]deps}
twine
commands =
{[testenv:build]commands}
twine upload --skip-existing --repository testpypi dist/*
[testenv:release]
basepython = python3
skip_install = true
deps =
{[testenv:build]deps}
twine
commands =
{[testenv:build]commands}
twine upload --skip-existing --repository pypi dist/*