-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
315 lines (267 loc) · 8.89 KB
/
Copy pathpyproject.toml
File metadata and controls
315 lines (267 loc) · 8.89 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
####################################################################################################
#
# Main configuration file for the [pyutilities] library. The whole project configuration (any
# setting) should be put here. Also configuration for dependencies and all code quality tools.
#
# Notes (code quality, etc.):
# - project line length = 110 symbols (black, flake8)
# - most of modules should be typed (used mypy stubs libraries)
#
# Created: Dmitrii Gusev, 30.05.2025
# Modified: Dmitrii Gusev, 25.05.2026
#
####################################################################################################
# -- build system information
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
# -- project / poetry utility meta-information
[project]
name = "pyutilities"
version = "2.6.0dev1"
description = "PyUtilities :: Useful python 3+ utilities library for various use cases."
authors = [
{name = "Dmitrii Gusev", email = "dmitry.ed.gusev@gmail.com"},
]
license = "MIT"
readme = "README.md"
requires-python = ">=3.10,<4"
keywords = [
"Python Utilities", "Useful Functions", "String Utilities", "CLI Functions", "toolset", "library",
"System Utilities", "Useful Decorators", "IO Functions"
]
classifiers = [
"Development Status :: 6 - Mature",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Topic :: Utilities",
"Typing :: Typed"
]
# - project runtime dependencies
dependencies = [
# -- loguru
"loguru==0.7.3",
# -- ms word / ms excel libraries
"xlrd~=2.0.1", # - allowed: >=2.0.1 <2.1.0
"xlwt==1.3.0",
"xlwings~=0.35",
"openpyxl==3.1.5",
# -- data validation and marshalling (JSON/YAML) --
"pydantic (>=2.12.5,<3.0.0)",
"pydantic-yaml ~=1.6",
"pydantic-settings ==2.*",
"marshmallow ~=4.1",
"pyyaml ==6.*",
"ruamel.yaml ==0.18.*",
# -- technical libraries
"urllib3~=2.6", # - allowed: >=2.3.0 <3.0.0
"paramiko ==5.*",
"requests~=2.32", # - allowed: >=2.32.0 <3.0.0
"markdown~=3.7", # - allowed: >=3.7.0 <4.0.0
"prettytable~=3.14", # - allowed: >=3.14.0 <4.0.0
"fake-useragent~=2.0", # - allowed: >=2.0.0 <3.0.0
"click~=8.3",
"python-dotenv ~=1.2", # - loading various .env configs
# -- terminal pseudo-graphics / pretty output
"prettytable ~=3.17", # - terminal tables
"pyfiglet ~=1.0", # - ASCII graphics
"rich-pyfiglet ~=1.0", # - ASCII graphics addon (colors)
# -- datetime utilities
"pendulum ~=3.2",
"python-dateutil ~=2.9",
"pytz ==2026.*"
]
# -- additional dependencies groups (test/research/etc. - not runtime)
[dependency-groups]
dev = [
# -- pytest library and extensions --
"pytest ==9.*", # - allowed any version < 10.0.0
"pytest-env ==1.*",
"pytest-cov ==7.*",
"pytest-mock ==3.*",
"pytest-pep8 ==1.0.6",
"pytest-flakes ==4.0.5",
"pytest-isort ==4.0.0",
"pytest-black ==0.6.0",
"pytest-variables[hjson,yaml,toml] ==3.1.0",
# -- testing-related libraries --
"mock ==5.*",
"mockito ~=2",
"nose2 ==0.*",
"hypothesis ==6.*",
# -- typing libraries + typing stubs for runtime dependencies --
"mypy ==2.*", # - typing library
"types-six ==1.*",
"types-mock ==5.*",
"types-paramiko ==4.*",
"types-requests ==2.*",
"types-markdown ==3.*",
"types-PyYAML ==6.*",
"types-flake8-bugbear ==25.*",
# -- code quality control libraries
"flake8 ==7.*",
"flake8-pyproject ~=1.2",
"flake8-bandit ~=4.1",
"flake8-bugbear ==25.*",
"black ~=26.0", # - code formatter
"pylint ~=4.0",
"pre-commit ~=4.0", # - pre-commit hook
"bandit ==1.9.*",
"isort[requirements_deprecated_finder,pipfile_deprecated_finder] ==8.*",
"pyflakes ~=3.4",
"codeaudit ~=1.4", # - SAST local analysis
# -- profiling/debugging libraries
"snakeviz ==2.2.2",
"memory-profiler ==0.61.0",
"py-spy ==0.4.1",
"viztracer ==1.1.1",
# -- development-related process libraries
"sphinx ==8.* ; python_version == '3.10'", # - docs lib - for python == 3.10
"sphinx ==9.* ; python_version >= '3.11' and python_version < '4.0'", # - docs lib - for python > 3.10
"watchdog ==6.0.0", # - file monitor and auto-reloader
"responses ==0.*", # - used by many testing/code quality libraries
# -- readline module depending on the platform
"pyreadline3 ==3.* ; sys_platform == 'win32' or sys_platform == 'cygwin'",
"gnureadline ==8.2.13 ; sys_platform != 'win32'"
]
research = [ # - research dependencies (Jupyter, etc.)
"notebook~=7.5" # allowed < 8.0.0
]
[tool.poetry]
packages = [{include = "pyutilities", from = "src"}]
# -- poetry :: source repositories setup
# [[tool.poetry.source]]
# name = "severstal_repo"
# url = "https://repo.severstal.severstalgroup.com/artifactory/api/pypi/pypi/simple/"
# priority = "primary" # - primary packages source
# priority = "supplemental" # - packages source will be used when primary is not available...
[tool.poetry.dependencies]
python = ">=3.10,<4"
[project.urls]
Homepage = "https://pypi.org/project/pyutilities"
Repository = "https://github.com/dmitry-ed-gusev/pyutilities"
Documentation = "https://github.com/dmitry-ed-gusev/pyutilities"
"Bug Tracker" = "https://github.com/dmitry-ed-gusev/pyutilities/issues"
[project.scripts]
pyutils = 'pyutilities.cli.pyutils:pyutils'
# -- flake8 tool
[tool.flake8]
# - list of ignored issues for the flake8 tool
# - (E501 - long line, F401 - unused import, E203 - whitespace before ':' - black puts it)
ignore = ['F401']
# - max cognitive complexity for statements
max-complexity = 10
# - line length aligned with same setting for [black] (88 chars by default) -> project value = 110
max-line-length = 110
# - ignored violations, specific per files
per-file-ignores = [
'tests/**:S101, S311',
]
# -- pylint tool
[tool.pylint.MASTER]
disable = [
'C0114', # missing-module-docstring
'C0115', # missing-class-docstring
'C0116', # missing-function-docstring
]
[tool.pylint.FORMAT]
max-line-length=110
max-module-lines=1000
# -- isort tool
[tool.isort]
profile = 'black'
multi_line_output = 3
line_length = 110
include_trailing_comma = true
skip_gitignore = true
skip_glob = ["**/migrations/*", "**/settings/*"]
# src_paths = ["./", "src/"]
src_paths = ["./src/"]
# -- black tool configuration
[tool.black]
line_length = 110
target-version = ['py310']
extend-exclude = '''
(
migrations # Alembic DB migrations
)
'''
# -- bandit tool
[tool.bandit]
exclude_dirs = ["tests"]
tests = ["B201", "B301"]
skips = ["B101", "B601"]
# -- mypy tool
[tool.mypy]
mypy_path = "./"
python_version = "3.10"
follow_imports = "silent"
strict_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
warn_unused_configs = true
disallow_any_generics = true
check_untyped_defs = true
no_implicit_reexport = true
allow_untyped_defs = true
# disallow_untyped_defs = true
# - mypy will ignore missing types defs imports
ignore_missing_imports = true
# - force mypy to analyze as best as its can module without types defs
follow_untyped_imports = true
# [[tool.mypy.overrides]]
# module = "pyutilities.web.http_client"
# disable_error_code = ["R0913", "too-many-arguments", "unused-argument"]
# -- pytest tool
[tool.pytest.ini_options]
minversion = "6.0"
addopts = """
--cov=./src/pyutilities --verbose --cov-report=html --cov-report=xml --cov-report=json --cov-report=annotate --capture=sys -rx --durations=0 --full-trace --color=auto --hypothesis-show-statistics --hypothesis-verbosity=verbose
"""
testpaths = [
"tests/",
"integration/",
]
mock_use_standalone_module = true
mock_traceback_monkeypatch = false
# - tests markers - tests can be grouped and executed by them
markers = [
"functional: these tests are significantly slower as they run the whole CLI script",
]
# -- env variables for tests in pytest
[tool.pytest_env]
# MY_VARIABLE = "my_value"
PYTHONTRACEMALLOC = 20
# -- coverage tool configuration (coveragerc)
[tool.coverage.run]
branch = true
data_file = ".coverage/.coverage"
omit = [
'*__init__*',
'*temp*',
'*tests\*'
]
[tool.coverage.report]
show_missing = true
# - show 2 decimal digits for coverage report values
precision = 2
# skip_covered = true
[tool.coverage.html]
directory = ".coverage/htmlcoverage"
title = "Python Utilities :: Tests Coverage Report."
[tool.coverage.xml]
output = ".coverage/coverage.xml"
# -- this setting is used by coverage.py, ignored by pytest-cov
[tool.coverage.json]
output = ".coverage/coverage.json"
pretty_print = true