-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
314 lines (283 loc) · 10.7 KB
/
pyproject.toml
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
[tool.poetry]
name = "incolume.py.tdd"
version = "2.10.0a2"
description = "Python Utilities for trainning"
authors = ["britodfbr <contato@incolume.com.br>"]
homepage="https://gitlab.com/development-incolume/treinamentos/incolumepy_tdd"
keywords = ['python', 'jedy', 'incolume', 'incolumepy', 'treinamento']
repository = 'https://gitlab.com/development-incolume/incolumepy.utils'
packages = [
{include = "incolume", from=''},
]
classifiers = [
'Development Status :: 5 - Production/Stable',
'Operating System :: OS Independent',
'Natural Language :: Portuguese (Brazilian)',
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: Free For Educational Use",
"Topic :: Education",
'Topic :: Utilities',
]
include = [
'README.md',
"CHANGELOG.md",
'docs/CONTRIBUTORS.md',
]
exclude = [
"examples/",
"ez_setup",
"tests/",
]
[tool.poetry.dependencies]
python = ">=3.8.0,<3.12.0"
[tool.poetry.group.dev.dependencies]
incolumepy-utils = {git = "https://gitlab.com/development-incolume/incolumepy.utils.git", rev = "2.10.0"}
blue = "^0.9.1"
bs4 = "^0.0.1"
faker = "^20.1.0"
fuzzywuzzy = "^0.18.0"
html5lib = "^1.1"
httpx = "^0.25.2"
ipdb = "^0.13.13"
lxml = "^4.9.3"
mock = "^5.1.0"
nose = "^1.3.7"
openpyxl = "^3.1.2"
pandas = ">=2.0.3"
pytest = "^7.4.3"
python-levenshtein = "^0.23.0"
python-magic = "^0.4.27"
requests = "^2.31.0"
rstr = ">=2.2.6"
ruff = "^0.1.6"
selenium-wire = "^5.1.0"
taskipy = "^1.12.2"
tox = "^4.11.3"
unidecode = "^1.3.7"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.pytest.ini_options]
log_format = '%(asctime)s; %(levelname)-8s; %(name)s; %(module)s; %(funcName)s; %(message)s'
log_date_format ='%FT%T%N%z'
#addopts = "--doctest-modules --cov=coding_dojo_jedi -sx --cov-report term-missing --cov-report html:coverage_report/html --cov-report xml:coverage_report/cov.xml"
testpaths = [
"tests",
"incolumepy/tdd",
]
python_files = [
"test_*.py",
"*_tests.py"
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"webtest: marks tests as webtest (deselect with '-m \"not webtest\"')",
"fast: marks tests as fast (deselect with '-m \"not fast\"')",
]
[tool.ruff]
# Always generate Python compatible code.
target-version = "py310"
# Decrease the maximum line length to 79 characters.
line-length = 79
indent-width = 4 # old tab-size
src = ["incolume/", "tests/"]
respect-gitignore = true
select = [
"A", #flake8-builtins
"AIR", #Airflow
"ANN", #flake8-annotations
"ARG", #flake8-unused-arguments
"ASYNC", #flake8-async
"B", #flake8-bugbear
"BLE", #flake8-blind-except
"C4", #flake8-comprehensions
"C90", #mccabe
"COM", #flake8-commas
"CPY", #flake8-copyright
"D", # pydocstyle
"DJ", #flake8-django
"DTZ", #flake8-datetimez
"E", # pycodestyle
"W", #pycodestyle
"EM", #flake8-errmsg
"ERA", #eradicate
"EXE", #flake8-executable
"F", # pyflakes
"FA", #flake8-future-annotations
"FBT", #flake8-boolean-trap
"FIX", #flake8-fixme
"FLY", #flynt
"FURB", #refurb
"G", #flake8-logging-format
"I", #isort
"ICN", #flake8-import-conventions
"INP", #flake8-no-pep420
"INT", #flake8-gettext
"ISC", #flake8-implicit-str-concat
"N", #pep8-naming
"NPY", #NumPy-specific rules
"PD", #pandas-vet
"PERF", #Perflint
"PGH", #pygrep-hooks
"PIE", #flake8-pie
"PL", #Pylint
"PT", #flake8-pytest-style
"PTH", #flake8-use-pathlib
"PYI", #flake8-pyi
"Q", #flake8-quotes
"RET", #flake8-return
"RSE", #flake8-raise
"RUF", #Ruff-specific rules
"S", #flake8-bandit
"SIM", #flake8-simplify
"SLF", #flake8-self
"SLOT", #flake8-slots
"T10", #flake8-debugger
"T20", #flake8-print
"TCH", #flake8-type-checking
"TD", #flake8-todos
"TID", #flake8-tidy-imports
"TRY", #tryceratops
"UP", # pyupgrade
"YTT", #flake8-2020
]
# Never enforce `E501` (line length violations).
ignore = ["INP001", "CPY001"]
# Avoid trying to fix flake8-bugbear (`B`) violations.
unfixable = ["B"]
[tool.ruff.per-file-ignores]
# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`.
#"__init__.py" = ["E402"]
#"path/to/file.py" = ["E402"]
"tests/*_tests.py" = ["S101", "N999", "PLR6301"]
"**/{tests,docs,tools,utils}/*" = ["EXE002"]
"**/test_*.py" = [
"I001",
"EXE002",
"ANN001",
"ANN101",
"PLR6301",
"S101",
]
[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 5
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.flake8-quotes]
docstring-quotes = "double" # ""single"
inline-quotes = "single"
multiline-quotes = "double"
[tool.tox]
legacy_tox_ini = """
[tox]
minversion = 3.1.0
isolated_build = True
envlist =
clean
# bandit
# black
blue
# isort
pydocstyle
flake8
# mypy
pylint
py{36,37,38,39,310,311,312,313}
;[tox:.package]
;basepython = python3
[testenv]
allowlist_externals = poetry
whitelist_externals = poetry
skip_install = true
commands =
poetry env use {envpython}
poetry install -vv --no-root
poetry run pytest {posargs} tests/ -m \"not(slow or webtest)\"
[testenv:clean]
deps = coverage
commands =
poetry run coverage erase
[testenv:linters]
commands =
#{[testenv:black]commands}
{[testenv:blue]commands}
{[testenv:isort]commands}
{[testenv:flake8]commands}
{[testenv:pydocstyle]commands}
{[testenv:mypy]commands}
{[testenv:pylint]commands}
[testenv:stats]
commands = poetry run pytest -vv
[testenv:flake8]
deps = flake8
commands = poetry run task lint_flake8
[testenv:mypy]
deps =
mypy
types-toml
commands = poetry run task lint_mypy
[testenv:pydocstyle]
commands = poetry run task lint_pydocstyle
[testenv:isort]
commands = poetry run task lint_isort
[testenv:pylint]
commands = poetry run task lint_pylint
[testenv:black]
commands = poetry run task lint_black
[testenv:blue]
commands = poetry run task lint_blue
[testenv:bandit]
commands = poetry run task bandit
[testenv:safety]
commands = poetry run task safety
"""
[tool.taskipy.variables]
path = "incolume/ tests/"
CHANGELOGFILE = "CHANGELOG.md"
VERSIONFILE = "incolume/py/tdd/version.txt"
URLCOMPARE = "https://github.com/incolume-jedi/incolumepy_tdd/compare"
[tool.taskipy.tasks]
#bandit={help='', cmd='poetry run bandit -c pyproject.toml -r {path}', use_vars=true}
#pre_check-all = {cmd='echo Starting Check all ..', help=''}
#check-all = {cmd='poetry run task clean-all; poetry run task lint; poetry run task sec', help = "Checking all" }
#post_check-all = {cmd='echo Checking finished!', help=''}
clean = {cmd = "echo -n 'Starting cleanning environment..'; find ./ \\( -wholename '*report_coverage' -o -name '*.pyc' -o -name '*~' -o -name '*.log' -o -name '*.log.*' -o -name '.cache' -o -name '.coverage' \\) -delete ; echo ' ok' ", help = "Shallow clean into environment (.pyc, .cache, .egg, .log, et all)" }
pre_clean-all = {cmd='poetry run task clean', help=''}
clean-all = {cmd = "echo -n 'Starting Deep cleanning ..'; find ./ \\( -name '*_cache' -o -name '*cache__' -o -name dist -o -name build -o -name .tox -o -name site -o -name coverage_report \\) -exec rm -rf {} 2> /dev/null \\; ; echo ' Deep cleaning finished!' ", help = "Deep cleanning into environment (dist, build, htmlcov, .tox, *_cache, et all)" }
pre_docs-build={help='Pre docs-build', cmd="poetry run task gcl"}
docs-build = {help="Generate documentation", cmd="poetry run mkdocs gh-deploy --config-file mkdocs.yml --remote-branch webdoc"}
docs-serve = {help="Run server documentation", cmd="poetry run mkdocs serve"}
lint-all = {help="Run all linters", cmd="poetry run task clean-all; poetry run task pre_lint && poetry run task lint_mypy && poetry run task lint_ruff"}
pre_lint="task lint_blue && task lint_isort && task lint_flake8 && task lint_pydocstyle && task lint_mypy && task lint_pylint"
lint={help='Checking all linters configurated', cmd=''}
lint_black={help='Checking with black', cmd='echo --black--; poetry run black --check --diff {path}', use_vars=true}
lint_blue={help='Checking with blue', cmd='echo --blue--; poetry run blue --check --diff {path}', use_vars=true}
lint_flake8={help='Checking with flake8', cmd='echo --flake8--; poetry run flake8 --config pyproject.toml {path}', use_vars=true}
lint_isort={help='Checking with isort', cmd='echo --isort--; poetry run isort --profile black --check --atomic --py all -m 3 {path}', use_vars=true}
lint_mypy={help='Checking with mypy', cmd='echo --mypy--; poetry run mypy --check {path}', use_vars=true}
lint_pydocstyle={help='Checking with pydocstyle', cmd='echo --pydocstyle--; poetry run pydocstyle {path}', use_vars=true}
lint_pylint={help='Checking with pylint', cmd='echo --pylint--; poetry run pylint {path}', use_vars=true}
lint_ruff={help='', cmd='echo --ruff--; poetry run ruff check --preview {path}', use_vars=true}
pre_patch={help='Run linters tools', cmd="poetry run task lint"}
patch={cmd='v=$(poetry version patch) && poetry run task tests && git ci -m "$v" pyproject.toml $(find incolume* -name version.txt)', help='Generate a patch Sematic Version'}
post_patch={help='Run securety tools', cmd="poetry run task bandit && poetry run task safety"}
premajor={cmd='v=$(poetry version premajor) && poetry run task tests && git ci -m "$v" pyproject.toml $(find incolume* -name version.txt)', help='poetry version premajor'}
preminor={cmd='v=$(poetry version preminor) && poetry run task tests && git ci -m "$v" pyproject.toml $(find incolume* -name version.txt)', help='poetry version preminor'}
prerelease={cmd='v=$(poetry version prerelease) && poetry version -s > {VERSIONFILE} && git ci -m "$v" pyproject.toml $(find incolume* -name version.txt)', help='poetry version prerelease', use_vars=true}
safety={help='Check safety of packages into project.', cmd='poetry run safety check'}
pre_sec={help='Securance validations', cmd='poetry run task bandit && poetry run task safety'}
sec={help="Checking environment's safety", cmd=''}
pre_changelog='poetry run pytest -m fast'
pre_tests={help='', cmd='task clean-all'}
tests={help='run all tests', cmd='poetry run pytest -m "not webtest"'}
pre_test-all={help='', cmd='task lint'}
test-all={help='Test all cases', cmd='task tests'}
changelog = {help='Update changelog file', cmd = "poetry run gcl {CHANGELOGFILE} -u {URLCOMPARE} && echo CHANGELOG file - {CHANGELOGFILE} - updated with success.;echo", use_vars = true }
gcl = {help='Update changelog file', cmd='poetry run task changelog'}
setup = { help = 'Configure environment develop', cmd='git config core.hooksPath .git-hooks/'}