-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
195 lines (173 loc) · 4.85 KB
/
Copy pathtox.ini
File metadata and controls
195 lines (173 loc) · 4.85 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
[tox]
minversion = 1.6
skipsdist = True
skip_missing_interpreters = True
envlist = py314,py313,py312,py311,py310,py39,syntax,cover,twine-check,cz
[testenv:black]
basepython = python3
envdir={toxworkdir}/black
deps = -r{toxinidir}/requirements-lint.txt
commands =
black {posargs} {toxinidir}/db2sql/ {toxinidir}/installer/
[testenv:isort]
basepython = python3
envdir={toxworkdir}/isort
deps = -r{toxinidir}/requirements-lint.txt
commands =
isort {posargs} {toxinidir}/db2sql/ {toxinidir}/installer/
[testenv:mypy]
basepython = python3
envdir={toxworkdir}/mypy
deps = -r{toxinidir}/requirements-lint.txt
commands =
mypy --ignore-missing-imports {posargs} {toxinidir}/db2sql/ {toxinidir}/installer/
[testenv:flake8]
basepython = python3
envdir={toxworkdir}/flake8
deps = -r{toxinidir}/requirements-lint.txt
commands =
flake8 {posargs} {toxinidir}/db2sql/ {toxinidir}/installer/
[testenv:pylint]
basepython = python3
envdir={toxworkdir}/lint
deps = -r{toxinidir}/requirements-lint.txt
commands =
pylint {posargs} {toxinidir}/db2sql/ {toxinidir}/installer/
[testenv:cz]
basepython = python3
envdir={toxworkdir}/cz
deps = -r{toxinidir}/requirements-lint.txt
commands =
cz check --rev-range HEAD
[testenv:twine-check]
basepython = python3
deps = -r{toxinidir}/requirements.txt
twine
build
commands =
python -m build .
twine check dist/*
[testenv:venv]
commands = {posargs}
[testenv:syntax]
basepython = python3
envdir={toxworkdir}/syntax
deps = -r{toxinidir}/requirements-lint.txt
commands =
black {posargs} --line-length 100 {toxinidir}/db2sql/ {toxinidir}/installer/
flake8 {posargs} {toxinidir}/db2sql/ {toxinidir}/installer/
isort {posargs} {toxinidir}/db2sql/ {toxinidir}/installer/
mypy --ignore-missing-imports {posargs} {toxinidir}/db2sql/ {toxinidir}/installer/
pylint {posargs} {toxinidir}/db2sql/ {toxinidir}/installer/
lint-imports
[testenv:import-linter]
basepython = python3
envdir = {toxworkdir}/import-linter
deps = -r{toxinidir}/requirements-lint.txt
commands =
lint-imports
[flake8]
exclude = .git,.venv,.tox,dist,*egg,build,
max-line-length = 100
# We ignore the following because we use black to handle code-formatting
# E203: Whitespace before ':'
# E501: Line too long
# W503: Line break occurred before a binary operator
# E704: Multiple statements on one line (def) — idiomatic for Protocol stubs (`def foo(...): ...`)
ignore = E203,E501,W503,E704
[testenv:docs]
basepython = python3
envdir = {toxworkdir}/docs
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/docs/requirements.txt
-e {toxinidir}
commands =
sphinx-build -b html -W --keep-going {toxinidir}/docs {toxinidir}/docs/_build/html
[testenv:pre-commit]
deps = -r{toxinidir}/requirements.txt
pre-commit
commands = pre-commit install -t pre-commit -t commit-msg --install-hooks
[testenv:installer]
basepython = python3
deps = -r{toxinidir}/requirements.txt
pyinstaller
commands = python installer/build.py
[testenv]
basepython = python3
deps = -r{toxinidir}/requirements.txt
pytest
-e {toxinidir}
commands =
pytest {posargs} {toxinidir}/tests/
[testenv:unit]
basepython = python3
envdir = {toxworkdir}/unit
deps = -r{toxinidir}/requirements.txt
pytest
-e {toxinidir}
commands =
pytest {posargs} {toxinidir}/tests/unit
[testenv:cli]
basepython = python3
envdir = {toxworkdir}/cli
deps = -r{toxinidir}/requirements.txt
pytest
-e {toxinidir}
commands =
pytest {posargs} {toxinidir}/tests/cli
[testenv:functional]
basepython = python3
envdir = {toxworkdir}/functional
deps = -r{toxinidir}/requirements.txt
pytest
pymssql
pymysql
cryptography
oracledb
psycopg2-binary
-e {toxinidir}
passenv =
MSSQL_*
MYSQL_*
ORACLE_*
PG_*
commands =
pytest -m functional {posargs} {toxinidir}/tests/functional
[testenv:functional-oracle]
# Oracle-only subset: requires only the Oracle container (heavy, on-demand).
basepython = python3
envdir = {toxworkdir}/functional-oracle
deps = -r{toxinidir}/requirements.txt
pytest
oracledb
-e {toxinidir}
passenv =
ORACLE_*
commands =
pytest -m oracle {posargs} {toxinidir}/tests/functional
[testenv:functional-light]
# Functional tests excluding the Oracle subset: needs MSSQL + MySQL + Postgres.
basepython = python3
envdir = {toxworkdir}/functional-light
deps = -r{toxinidir}/requirements.txt
pytest
pymssql
pymysql
cryptography
psycopg2-binary
-e {toxinidir}
passenv =
MSSQL_*
MYSQL_*
PG_*
commands =
pytest -m "functional and not oracle" {posargs} {toxinidir}/tests/functional
[testenv:cover]
basepython = python3
envdir = {toxworkdir}/cover
deps = -r{toxinidir}/requirements.txt
pytest
pytest-cov
-e {toxinidir}
commands =
pytest --cov=db2sql --cov-report=term-missing --cov-report=html {posargs} {toxinidir}/tests/