-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
285 lines (246 loc) · 8.37 KB
/
Copy pathpyproject.toml
File metadata and controls
285 lines (246 loc) · 8.37 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
# This is a comment.
# syntax-documentation:
# - https://python-poetry.org/docs/pyproject
# - https://flit.readthedocs.io/en/latest/pyproject_toml.html
# - https://toml.io/en/
#
# NOTE: you have to use single-quoted strings in TOML for regular expressions.
# It's the equivalent of r-strings in Python. Multiline strings are treated as
# verbose regular expressions by Black. Use [ ] to denote a significant space
# character.
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.bandit]
# bandit does not use this config by default.
# You need to invoke "bandit --configfile pyproject.toml"
# see https://github.com/PyCQA/bandit/issues/318"
# baseline = "etc/bandit-baseline.json"
exclude_dirs = [".venv", "var"]
recursive = true
skips = [
# see https://bandit.readthedocs.io/en/1.7.3/plugins/index.html#plugin-id-groupings
# "B101", # assert_used
]
targets = ["docs", "src", "tests"]
[tool.bandit.assert_used]
skips = ["*/test_*.py"]
[tool.coverage.html]
directory = "var/html/coverage"
[tool.coverage.xml]
output = "var/html/coverage/coverage.xml"
[tool.coverage.report]
# cfr. https://coverage.readthedocs.io/en/coverage-4.2/excluding.html
exclude_lines = [
"pragma: no cover",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
]
include = ["src/*"]
[tool.coverage.run]
branch = true
data_file = "var/cache/coverage/coverage.db" # defaults to .coverage
# [tool.isort]
# include_trailing_comma = true # corresponds to -tc flag
# known_third_party = []
# line_length = 120 # corresponds to -w flag
# multi_line_output = 3 # corresponds to -m flag
# skip_glob = '^((?!py$).)*$' # isort all Python files
[tool.mypy]
# cfr https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file
cache_dir = "var/cache/mypy"
check_untyped_defs = true
# disallow_untyped_defs = true
exclude = "^bin/"
ignore_missing_imports = true
# mypy_path = ["etc/ipython/startup", "src", "tests"]
pretty = true
show_column_numbers = true
show_error_codes = true
show_error_context = true
[project]
name = "libranet-logging"
version = "1.5.3"
requires-python = ">=3.8"
description = "Easy-to-use logging-configuration using a logging.yml-file"
readme = "docs/readme.md"
# license = "MIT"
license = { file = "license.md" }
authors = [{name = "Wouter Vanden Hove", email = "wouter@libranet.eu"}]
maintainers = [{name = "Wouter Vanden Hove", email = "wouter@libranet.eu"}]
keywords = ["libranet", "logging", "filters", "handlers", "loggers", "yaml"]
classifiers = [
# Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries",
"Typing :: Typed",
]
dependencies = [
"colorlog >=6.7",
"jsonschema >=4.23",
"logging-tree >=1.9",
"pyyaml >=6.0",
"importlib_metadata >=7.1.0,<8; python_version < '3.10'",
"importlib-resources>=6.4.5 ; python_full_version < '3.11'",
]
[project.urls]
Docs = "https://libranet-logging.readthedocs.io/en/latest/"
Pypi = "https://pypi.org/project/libranet-logging"
Repo = "https://github.com/libranet/libranet-logging"
Issues = "https://github.com/libranet/libranet-logging/issues"
Changelog = "https://github.com/libranet/libranet-logging/blob/main/docs/changes.rst"
[dependency-groups]
dev = [
"absolufy-imports >=0.3",
"toml-cli >=0.7.0",
]
docs = [
"autoapi>=2.0.1",
"recommonmark >= 0.7.1",
"sphinx >= 7.1.2",
"sphinx-autoapi >= 3.3.3",
"sphinx-rtd-theme >= 3.0.1",
]
ipython = [
"ipdb >= 0.13.13",
"ipython >= 8.12.3",
]
linting = [
"pylint >= 3.2.7",
"ruff >= 0.7.2",
]
pre-commit = [
"pre-commit >=3.5",
"pre-commit-hooks >=5.0.0",
]
releasing = [
"pyroma>=4.0",
]
testing = [
"pytest >= 8.3",
"pytest-clarity >= 1.0",
"pytest-click >= 1.1",
"pytest-cov >= 5.0",
"pytest-mock >= 3.14",
]
typing = [
# lxml = { version = ">=4.9", optional = true, allow-prereleases = false } # mypy coverage-report
"lxml >=4.9", # mypy coverage-report
"mypy >= 1.13.0",
"types-pyyaml >=6.0",
]
# https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/
# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#advanced-plugins
# https://github.com/Darsstar/sitecustomize-entrypoints/blob/main/src/sitecustomize/__init__.py
[project.entry-points.sitecustomize]
# libranet_logging_pyyaml = "libranet_logging.yaml:add_constructor"
# libranet_logging_ruaml = "libranet_logging.yaml:add_constructor"
[tool.pylint.design]
# complete pylint-config, see https://github.com/PyCQA/pylint/blob/main/pylintrc
exclude-too-few-public-methods = "pydantic.*"
max-attributes = 75 # default is 11
[tool.pylint.format]
max-line-length = 120
good-names = [
"i", # counter in loop
"ok", # status
"ts", # timestamp or timeseries object
"t0",
"t1",
]
[tool.pylint.messages_control]
disable = [
"R0402", # consider-using-from-import
"R0801", # duplicate-code
"W0703", # broad-except
"W1203", # logging-fstring-interpolation
"W0511", # fixme / todo
"C0116", # missing-function-docstring
]
[tool.pylint.type_check]
# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis. It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules = []
[tool.pytest.ini_options]
markers = ["integration", "unit", "slow"]
testpaths = ["tests"]
# the junit-report is used to report coverage in gitlab
addopts = "--junit-xml='var/cache/coverage/pytest.xml'"
cache_dir = "var/cache/pytest"
log_cli = false # enable to show log-output
log_cli_level = "NOTSET"
filterwarnings = [
# "ignore:Coverage disabled via --no-cov switch!:pytest.PytestWarning:pytest_cov.plugin",
# "ignore::DeprecationWarning", # use of pgk_rescources in cerberus
]
[tool.ruff]
# https://beta.ruff.rs/docs/configuration/
# https://github.com/pandas-dev/pandas/blob/main/pyproject.toml
cache-dir = "var/cache/ruff" # relative to this file
line-length = 120
target-version = "py38"
[tool.ruff.lint]
# respect-gitignore = true
select = ["ALL"]
ignore = [
"B011", # Do not call assert False since python -O removes these calls.
"COM812", # Trailing comma missing - conflicts with ruff format
"ERA001", # Found commented-out code
"G004", # Logging statement uses f-string
"RET504", # Unnecessary assignment before `return` statement
# D212 conflicts with D213 - we prefer D212, so we ignore D213
"D213", # Multi-line docstring summary should start at the second line
# D211 conflicts with D203 - we prefer D211, so we ignore D203
"D203", # 1 blank line required before class docstring
]
[tool.ruff.lint.per-file-ignores]
"docs/**" = [
"INP001", # docs-dir should not be a python-package
]
"etc/ipython/*/ipython_*config.py" = [
"E501", # line-too-long
]
"tests/**" = [
"ANN", # Missing type annotations
"ARG001", # Unused function argument
"D", # Missing docstring
"INP001", # tests-dir should not be a python-package
"S101", # Use of `assert` detected
]
# [tool.ruff.flake8-quotes]
# # cfr https://github.com/python-poetry/cleo/blob/main/pyproject.toml
# inline-quotes = "double"
# [tool.ruff.flake8-tidy-imports]
# ban-relative-imports = "all"
# [tool.ruff.mccabe]
# # Unlike Flake8, default to a complexity level of 10.
# max-complexity = 10
# [tool.sort.config]
# # https://pypi.org/project/poetry-sort/
# # https://github.com/celsiusnarhwal/poetry-sort
# auto = true
# case-sensitive = false
# sort-python = false
# format = true
[tool.uv]
package = true
default-groups = "all"
required-version = ">=0.6.8"