-
Notifications
You must be signed in to change notification settings - Fork 58
/
pyproject.toml
215 lines (196 loc) · 7.12 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "concurrent-log-handler"
dynamic = ["version"]
description = "RotatingFileHandler replacement with concurrency, gzip and Windows support"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.6"
authors = [
{ name = "Preston Landers", email = "[email protected]" },
]
keywords = [
"QueueHandler",
"QueueListener",
"linux",
"logging",
"portalocker",
"rotate",
"unix",
"windows",
]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: Apache Software License",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Logging",
]
dependencies = [
"portalocker>=1.6.0",
]
[project.urls]
Homepage = "https://github.com/Preston-Landers/concurrent-log-handler"
[tool.hatch.version]
path = "src/concurrent_log_handler/__version__.py"
[tool.hatch.build.targets.sdist]
include = [
"/src",
]
[tool.hatch.envs.test]
dependencies = [
"coverage[toml] >= 7.2",
"pytest >= 7.4",
"pytest-sugar",
]
[tool.hatch.envs.test.scripts]
version = "python3 --version"
pip-list = "pip list"
test = "pytest {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
cov-clear = "coverage erase"
cov-report = [
"- coverage combine",
"coverage report",
]
cov-html = "coverage html"
cov-json = "coverage json"
cov = [
"version",
"pip-list",
"cov-clear",
"test-cov",
"cov-report",
"cov-json",
"cov-html"
]
[[tool.hatch.envs.test.matrix]]
python = ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
[tool.hatch.envs.lint]
detached = true
dependencies = [
"black>=23.9.1",
"mypy>=1.6.0",
"ruff>=0.1.0",
"portalocker",
]
[tool.hatch.envs.lint.scripts]
typing = [
"mypy --version",
"mypy --install-types --non-interactive {args:src/concurrent_log_handler}"
]
style = [
"ruff {args:.}",
"black --check --diff {args:.}",
]
fmt = [
"black {args:.}",
"ruff {args:.}",
"style",
]
all = [
"style",
"typing",
]
[tool.ruff]
output-format = "grouped"
target-version = "py37"
fix = true
ignore = [
# Never enforce `E501` (line length violations).
"E501",
"D415", # First line of docstring should end with a period
"COM812", # missing trailing comma in Python 3.5+
"UP008", # use of super(class, self) - probably can re-apply this at some point
"SIM115", # Use context handler for open()
"PLR1711", # useless return stmt
"EM101", # use of string literal in exception
"EM102", # using f-string in exception literal
"T201", # use of print
"SLF001", # access to _ private members
"EXE001", # executable bit set (might want to revisit the ignore)
]
select = [
"E", # pycodestyle Errors - https://docs.astral.sh/ruff/rules/#error-e
"W", # pycodestyle Warnings - https://docs.astral.sh/ruff/rules/#warning-w
"F", # Pyflakes - https://docs.astral.sh/ruff/rules/#pyflakes-f
"C90", # McCabe complexity - https://docs.astral.sh/ruff/rules/#mccabe-c90
"I", # import sorting - https://docs.astral.sh/ruff/rules/#isort-i
# "D", # pydoc style - https://docs.astral.sh/ruff/rules/#pydocstyle-d
# "UP", # python upgrade - https://docs.astral.sh/ruff/rules/#pyupgrade-up
"YTT", # sys.version misused - https://docs.astral.sh/ruff/rules/#flake8-2020-ytt
# "ANN", # annotations - https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"S", # flake8 bandit - https://docs.astral.sh/ruff/rules/#flake8-bandit-s
# "BLE", # blind exceptions - https://docs.astral.sh/ruff/rules/#flake8-blind-except-ble
# "FBT", # boolean trap - https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
"B", # bugbear - https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"A", # flake8 builtins - https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"COM", # flake8 commas - https://docs.astral.sh/ruff/rules/#flake8-commas-com
"C4", # flake8 comprehensions - https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"DTZ", # flake8 datetime - https://docs.astral.sh/ruff/rules/#flake8-datetime-dtz
"EM", # flake8 error messages - https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"EXE", # flake8 executables https://docs.astral.sh/ruff/rules/#flake8-executable-exe
"ISC", # implicit string concat https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc
"ICN", # import conventions - https://docs.astral.sh/ruff/rules/#flake8-import-conventions-icn
"G", # flake8 logging - https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"INP", # https://docs.astral.sh/ruff/rules/#flake8-no-pep420-inp
"PIE", # https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"T20", # https://docs.astral.sh/ruff/rules/#flake8-print-t20
"PYI", # https://docs.astral.sh/ruff/rules/#flake8-pyi-pyi
"PT", # https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"Q", # https://docs.astral.sh/ruff/rules/#flake8-quotes-q
"RSE", # https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RET", # https://docs.astral.sh/ruff/rules/#flake8-return-ret
"SLF", # https://docs.astral.sh/ruff/rules/#flake8-self-slf
"SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"TID", # https://docs.astral.sh/ruff/rules/#flake8-tidy-imports-tid
"TCH", # https://docs.astral.sh/ruff/rules/#flake8-type-checking-tch
"INT", # https://docs.astral.sh/ruff/rules/#flake8-gettext-int
"ARG", # https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
# "PTH", # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
# "ERA", # https://docs.astral.sh/ruff/rules/#eradicate-era
"PD", # https://docs.astral.sh/ruff/rules/#pandas-vet-pd
"PGH", # https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
# Pylint
"PLC", # https://docs.astral.sh/ruff/rules/#convention-plc
"PLE", # https://docs.astral.sh/ruff/rules/#error-ple
"PLR", # https://docs.astral.sh/ruff/rules/#refactor-plr
"PLW", # https://docs.astral.sh/ruff/rules/#warning-plw
# "TRY", # https://docs.astral.sh/ruff/rules/#tryceratops-try
"NPY", # https://docs.astral.sh/ruff/rules/#numpy-specific-rules-npy
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
]
[tool.pytest.ini_options]
testpaths =["tests"]
[tool.coverage.run]
omit = [
"tests/stresstest.py"
]
[tool.mypy]
python_version = "3.8"
platform = "linux"
disallow_any_unimported = true
disallow_any_explicit = true
disallow_untyped_defs = true
disallow_untyped_calls = true
disallow_incomplete_defs = true
check_untyped_defs = true
strict_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true