-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
321 lines (273 loc) · 6.88 KB
/
Copy pathtox.ini
File metadata and controls
321 lines (273 loc) · 6.88 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
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
[tox]
# Desteklenen Python versiyonları
envlist = py38,py39,py310,py311,py312,flake8,coverage,safety
skip_missing_interpreters = true
isolated_build = true
[gh-actions]
# GitHub Actions için Python version mapping
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
[testenv]
# Temel test environment konfigürasyonu
deps =
-rrequirements.txt
-rrequirements-test.txt
commands =
python -m pytest {posargs}
# Test ortamı için environment variables
setenv =
PYTHONPATH = {toxinidir}
BOT_TOKEN = test_token_12345
DB_HOST = localhost
DB_USER = test_user
DB_PASSWORD = test_password
DB_NAME = test_vergi_bot_db
# Test sırasında değiştirilmesi gereken dizinler
changedir = {toxinidir}
[testenv:py38]
# Python 3.8 spesifik testler
basepython = python3.8
deps = {[testenv]deps}
commands =
python -m pytest --cov=. --cov-report=xml --cov-report=html --cov-report=term-missing {posargs}
[testenv:py39]
# Python 3.9 spesifik testler
basepython = python3.9
deps = {[testenv]deps}
commands =
python -m pytest --cov=. --cov-report=xml --cov-report=html --cov-report=term-missing {posargs}
[testenv:py310]
# Python 3.10 spesifik testler
basepython = python3.10
deps = {[testenv]deps}
commands =
python -m pytest --cov=. --cov-report=xml --cov-report=html --cov-report=term-missing {posargs}
[testenv:py311]
# Python 3.11 spesifik testler
basepython = python3.11
deps = {[testenv]deps}
commands =
python -m pytest --cov=. --cov-report=xml --cov-report=html --cov-report=term-missing {posargs}
[testenv:py312]
# Python 3.12 spesifik testler
basepython = python3.12
deps = {[testenv]deps}
commands =
python -m pytest --cov=. --cov-report=xml --cov-report=html --cov-report=term-missing {posargs}
[testenv:flake8]
# Code linting with flake8
basepython = python3.9
deps =
flake8>=4.0.0
flake8-docstrings>=1.6.0
flake8-import-order>=0.18.0
flake8-bugbear>=22.0.0
commands =
flake8 bot.py database.py scraper.py main.py bot_handlers.py
[testenv:pylint]
# Alternative linting with pylint
basepython = python3.9
deps =
pylint>=2.12.0
-rrequirements.txt
commands =
pylint bot.py database.py scraper.py main.py bot_handlers.py
[testenv:mypy]
# Type checking with mypy
basepython = python3.9
deps =
mypy>=0.991
types-requests
types-python-dateutil
-rrequirements.txt
commands =
mypy bot.py database.py scraper.py main.py bot_handlers.py
[testenv:coverage]
# Coverage reporting
basepython = python3.9
deps =
-rrequirements.txt
-rrequirements-test.txt
commands =
python -m pytest --cov=. --cov-report=html --cov-report=xml --cov-report=term-missing --cov-fail-under=80
coverage html
coverage xml
[testenv:coverage-report]
# Sadece coverage raporu göster
basepython = python3.9
deps = coverage
skip_install = true
commands =
coverage report --show-missing
coverage html
[testenv:safety]
# Security vulnerability check
basepython = python3.9
deps =
safety>=2.0.0
commands =
safety check --json
[testenv:bandit]
# Security linting
basepython = python3.9
deps =
bandit>=1.7.0
commands =
bandit -r bot.py database.py scraper.py main.py bot_handlers.py
[testenv:docs]
# Documentation build test
basepython = python3.9
deps =
sphinx>=4.0.0
sphinx-rtd-theme
commands =
sphinx-build -b html docs docs/_build/html
[testenv:format]
# Code formatting with black and isort
basepython = python3.9
deps =
black>=22.0.0
isort>=5.10.0
commands =
black --check --diff bot.py database.py scraper.py main.py bot_handlers.py tests/
isort --check-only --diff bot.py database.py scraper.py main.py bot_handlers.py tests/
[testenv:format-fix]
# Auto-format code
basepython = python3.9
deps =
black>=22.0.0
isort>=5.10.0
commands =
black bot.py database.py scraper.py main.py bot_handlers.py tests/
isort bot.py database.py scraper.py main.py bot_handlers.py tests/
[testenv:unit]
# Sadece unit testler
basepython = python3.9
deps = {[testenv]deps}
commands =
python -m pytest tests/ -m "unit" {posargs}
[testenv:integration]
# Sadece integration testler
basepython = python3.9
deps = {[testenv]deps}
commands =
python -m pytest tests/ -m "integration" {posargs}
[testenv:database]
# Sadece database testleri
basepython = python3.9
deps = {[testenv]deps}
commands =
python -m pytest tests/ -m "database" {posargs}
[testenv:scraper]
# Sadece scraper testleri
basepython = python3.9
deps = {[testenv]deps}
commands =
python -m pytest tests/ -m "scraper" {posargs}
[testenv:bot]
# Sadece bot testleri
basepython = python3.9
deps = {[testenv]deps}
commands =
python -m pytest tests/ -m "bot" {posargs}
[testenv:slow]
# Yavaş testler
basepython = python3.9
deps = {[testenv]deps}
commands =
python -m pytest tests/ -m "slow" --timeout=60 {posargs}
[testenv:fast]
# Hızlı testler (slow hariç)
basepython = python3.9
deps = {[testenv]deps}
commands =
python -m pytest tests/ -m "not slow" {posargs}
[testenv:network]
# Network gerektiren testler
basepython = python3.9
deps = {[testenv]deps}
commands =
python -m pytest tests/ -m "requires_network" {posargs}
[testenv:no-network]
# Network gerektirmeyen testler
basepython = python3.9
deps = {[testenv]deps}
commands =
python -m pytest tests/ -m "not requires_network" {posargs}
[testenv:clean]
# Temizlik
basepython = python3.9
deps =
skip_install = true
allowlist_externals =
rm
find
commands =
rm -rf {toxinidir}/htmlcov/
rm -rf {toxinidir}/.coverage
rm -rf {toxinidir}/coverage.xml
rm -rf {toxinidir}/.pytest_cache/
rm -rf {toxinidir}/__pycache__/
find {toxinidir} -name "*.pyc" -delete
find {toxinidir} -name "__pycache__" -type d -exec rm -rf {} +
[flake8]
# Flake8 konfigürasyonu
max-line-length = 88
extend-ignore =
E203, # whitespace before ':'
E501, # line too long (handled by black)
W503, # line break before binary operator
F401, # imported but unused (handled by autoflake)
exclude =
.tox,
.git,
__pycache__,
docs/source/conf.py,
build,
dist,
.eggs,
*.egg,
.venv,
venv/,
env/,
logs/
max-complexity = 10
import-order-style = google
docstring-convention = google
[coverage:run]
# Coverage konfigürasyonu
source = .
omit =
tests/*
.tox/*
venv/*
env/*
.venv/*
*/site-packages/*
setup.py
branch = true
parallel = true
[coverage:report]
# Coverage rapor konfigürasyonu
exclude_lines =
pragma: no cover
def __repr__
raise AssertionError
raise NotImplementedError
if __name__ == .__main__:
if TYPE_CHECKING:
show_missing = true
precision = 2
skip_covered = false
skip_empty = false
[coverage:html]
# HTML coverage raporu
directory = htmlcov
title = Vergi Hatırlatıcı Bot Coverage Report
[coverage:xml]
# XML coverage raporu
output = coverage.xml