-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
229 lines (205 loc) · 5.48 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
# --- Poetry config --------------------------------------------- #
[tool.poetry]
name = "newsbot"
version = "0.0.1"
description = "News Telegram Bot by PythonBiellaGroup"
authors = ["PythonBiellaGroup"]
license = "MIT"
keywords = [
"Base",
"Project",
"Template",
]
package-mode = false
[build-system]
requires = ["poetry-core>=1.8.1"]
build-backend = "poetry.core.masonry.api"
[[tool.poetry.source]]
name = "pypi.org"
url = "https://pypi.org/simple"
priority = 'primary'
[tool.poetry.dependencies]
python = ">=3.10, <=3.12"
cookiecutter = ">=2.3.0"
detect-secrets=">=1.4.0"
ecs-logging = ">=2.1.0"
loguru = ">=0.7.2"
pyaml=">=23.9.6"
pydantic=">=2.3.0"
python-dotenv=">=1.0.0"
Unidecode=">=1.3.6"
pytz = "^2024.1"
python-telegram-bot = {extras = ["job-queue"], version = "^21.2"}
feedparser = "^6.0.11"
lxml = "^5.2.2"
beautifulsoup4 = "^4.12.3"
requests = "^2.32.3"
h11 = "^0.14.0"
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
mkdocs = ">=1.5.3"
mkdocs-autorefs = ">=0.5.0"
mkdocs-macros-plugin = ">=1.0.5"
mkdocs-material = ">=9.5.5"
mkdocs-minify-plugin = ">=0.7.2"
mkdocs-redirects = ">=1.2.1"
mkdocstrings = ">=0.24.0"
mkdocstrings-python = ">=1.8.0"
[tool.poetry.group.dev.dependencies]
black = ">=23.12.1"
commitizen = ">=3.13.0"
deptry = ">=0.12.0"
isort = ">=5.13.2"
jupyter = ">=1.0.0"
memory-profiler = ">=0.61.0"
mypy = ">=1.8.0"
pre-commit = ">=3.6.0"
pytest = ">=7.4.4"
pytest-cov = ">=4.1.0"
ruff = ">=0.1.14"
tox = ">=4.12.1"
# --- Plugins configurations --------------------------------------------- #
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
line_length = 120
profile = "black"
[tool.black]
line-length = 120
target-version = ['py39']
preview = true
[tool.mypy]
plugins = ["pydantic.mypy", "sqlmypy"]
disallow_untyped_defs = true
disallow_any_unimported = true
ignore_missing_imports = true
no_implicit_optional = true
check_untyped_defs = true
warn_return_any = true
warn_unused_ignores = true
show_error_codes = true
exclude = ['volumes/', "alembic/", "scripts/", "docs/", "settings/", ".vscode/", ".venv/", ".pytest_cache/", ".mypy_cache/", ".gitlab/", ".github/", ".devcontainer/", "Docker/", "dashboards/"]
[tool.coverage.report]
skip_empty = true
[tool.coverage.run]
branch = true
source = ["app"]
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "v$major.$minor.$patch$prerelease"
version = "0.1.0"
version_files = [
"__version__.py",
"pyproject.toml:version"
]
style = [
["qmark", "fg:#ff9d00 bold"],
["question", "bold"],
["answer", "fg:#ff9d00 bold"],
["pointer", "fg:#ff9d00 bold"],
["highlighted", "fg:#ff9d00 bold"],
["selected", "fg:#cc5454"],
["separator", "fg:#cc5454"],
["instruction", ""],
["text", ""],
["disabled", "fg:#858585 italic"]
]
#### RUFF
[tool.ruff]
line-length = 120
indent-width = 4
# Assume Python 3.10.
target-version = "py310"
# A list of file patterns to include when linting.
include = ["**/pyproject.toml", "*.py", "*.pyi"]
# extend-include = ["*.ipynb"]
# Always autofix, but never try to fix `F401` (unused imports).
fix = true
# Exclude a variety of commonly ignored directories (you can have some problems)
exclude = [
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
".venv",
"*ipynb_checkpoints",
"*.ipynb"
]
[tool.ruff.lint]
fixable = ["ALL"]
unfixable = ["F401"]
# Rules: https://beta.ruff.rs/docs/rules/
# Enable Pyflakes `E` and `F` codes by default.
select = [
#default
"E", # pycodestyle error
"F", #flake8 error
#extra
"A", # bultin shadowing
"B", # flake8 bugbear
"BLE", # aboid bare excepts
"C4", # simplify comprehensions
"D", # docstyle
"DTZ", # datetime errors
"FBT", # avoid boolean trap
"G", # logging format
"I", # flake8-isort import
"N", # pep8 naming
"RET", # return statements values
"S", # bandit
"YTT", # wrong usage of sys.info
"B", # flake8-bugbear
]
ignore = [
"B008", # do not perform function calls in argument defaults
"BLE001", #Do not catch blind exception: {name}
"C901", # too complex
"D107", # Missing docstring in __init__
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D417", # Missing argument description in the docstring for {definition}: {name}
"E501", # Line too long ({width} > {limit} characters)
"E501", # line too long, handled by black
"D100",
"FBT001", # boolean trap
"FBT002", # boolean trap
"G004" # logging statement using fstring formatting
]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = ">=(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.format]
# select = ["E4", "E7", "E9", "F"]
# exclude = ["*.ipynb"]
# ignore = []
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.isort]
known-third-party = ["fastapi", "pydantic", "starlette"]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["D104", "F401", "I002"]
"test*.py" = ["S101", "T201"]