-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
292 lines (276 loc) · 6.39 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
[tool.poetry]
name = "rejx"
version = "0.1.0"
description = "Rej(spe)X - Deal with .rej file with minimal pain"
authors = ["Markus Sagen <[email protected]>"]
keywords = ["git", "cookiecutter", "cruft", "rej"]
readme = "README.md"
license = "MIT"
homepage = "https://github.com/markussagen/rejx"
repository = "https://github.com/markussagen/rejx"
include = ["LICENSE"]
[tool.poetry.dependencies]
python = ">=3.8,<4.0"
typer = ">=0.8.0"
rich = ">=12.0.0"
[tool.poetry.group.dev.dependencies]
# cmd
pre-commit = "3.4.0"
ipykernel = "^6.20.0"
# linter and formatter
ruff = "0.4.10"
# testing
pytest = ">=7.4.2"
pytest-asyncio = "^0.23.4"
pytest-cov = ">=4.1.0"
pytest-mock = ">=3.11.1"
pytest-xdist = ">=3.0.0"
pytest-better-parametrize = "^0.2.0"
pytest-clarity = "^1.0.1"
pytest-pretty = "^1.2.0"
pytest-env = "^1.1.3"
pytest-schema = "^0.1.2"
pytest-md-report = "^0.5.1"
pytest-doctestplus = "^1.2.1"
pytest-doctest-mkdocstrings = "^0.1.1"
pytest-markdown-docs = "^0.5.1"
pytest-accept = "^0.1.10"
pytest-mypy = "*"
deepdiff = "^6.7.1"
# debug
debugpy = "^1.8.0"
ptvsd = "^4.3.2"
devtools = ">=0.12.0"
# type checking
mypy = ">=1.2.0"
pyright = ">=1.1.356"
no-implicit-optional = "^1.3"
types-tabulate = ">=0.9.0.20240106"
# Testing template management and rej files
cruft = "^2.15.0"
[tool.ruff]
# -- cmd config
fix = true
preview = true
# settings
line-length = 120
target-version = "py310"
builtins = ["_"]
cache-dir = "~/.cache/ruff"
src = ["src", "tests"]
include = ["*.py"]
extend-exclude = ["test_*.py", "tests", "docs"]
[tool.ruff.format]
# -- cmd config
preview = true
# settings
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = true
docstring-code-line-length = "dynamic"
exclude = ["**/__init__.py"]
[tool.ruff.lint]
# -- cmd config
preview = true
# settings
flake8-quotes = { inline-quotes = "double", multiline-quotes = "double" }
flake8-tidy-imports = { ban-relative-imports = "all" }
flake8-comprehensions = { "allow-dict-calls-with-keyword-arguments" = true } # C408 - Allow dict calls with keyword arguments
isort = { known-first-party = ["heimdall", "tests"] }
mccabe = { max-complexity = 10 }
pydocstyle = { convention = "google" }
exclude = ["*.ipynb"]
ignore = [
"E203",
"E501",
"FIX002",
"PTH123",
"C901",
"PD101",
"COM812",
"PTH118",
"PTH207",
"PTH207",
"UP007",
"B008",
] # Typer does not support UP007
extend-select = [
"Q",
"RUF100",
"C90",
"UP",
"I",
"T",
"B",
"F",
"Q",
"COM812",
] # "D",
extend-ignore = [
"D105",
"D107",
"D205",
"D415",
"EM101",
"G004",
"ARG001",
"ARG002",
"PD901",
"RET504",
]
fixable = [
"F",
"N",
"D",
"W",
"INP",
"PLC",
"PLR",
"PLW",
"RUF",
"SIM",
"Q",
"UP",
"TID",
"I",
"EM",
"FBT",
"PD",
"E501",
]
extend-safe-fixes = ["E", "F401", "E501"]
extend-unsafe-fixes = ["E", "F401", "E501"]
select = [
"F", # pyflakes
"E", # pycodestyle
"W", # pycodestyle
"C90", # mccabe
"I", # isort
# "D", # pydocstyle
"ASYNC", # flake8-async
"A", # flake8-builtins
"COM", # flake8-commas
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"EM", # flake8-errmsg
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"INP", # flake8-no-pep420
"PIE", # flake8-pie
"T20", # flake8-print
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
"INT", # flake8-gettext
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"FIX", # flake8-fixme
"ERA", # eradicate
"PD", # pandas-vet
"PGH", # pygrep-hooks
"NPY", # NumPy-specific rules
"PERF", # Perflint
"RUF", # Ruff-specific rules
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["D104", "E402", "F401", "F403", "F811", "W292"]
"test_*.py" = ["ANN201", "S101"]
[tool.coverage.run]
omit = ['*/.local/*', '__init__.py', 'tests/*', '*/tests/*', '.venv/*']
[tool.coverage.report]
fail_under = 0 # TODO: increase this
show_missing = true
precision = 2
skip_empty = true
exclude_lines = [
'pragma: no cover',
'raise NotImplementedError',
'if TYPE_CHECKING:',
'if typing.TYPE_CHECKING:',
'@overload',
'@typing.overload',
'\(Protocol\):$',
'typing.assert_never',
'assert_never',
]
[tool.coverage.paths]
source = ['src/rejx/']
[tool.pytest.ini_options]
# https://github.com/kedro-org/kedro/blob/main/pyproject.toml
testpaths = ["tests", "src/rejx"]
filterwarnings = ['error']
xfail_strict = true
# pytest flags
addopts = [
'--cov-context',
'test',
'--cov-config',
'pyproject.toml',
'--cov-report',
'term',
'--cov-report',
'html:reports/coverage-html',
'--cov-report',
'xml:reports/coverage.xml',
'--cov-report',
'term-missing',
'--cov=.',
'--no-cov-on-fail',
'--ignore=docs',
'--capture=no',
'--log-cli-level=WARNING',
'-ra',
'-W',
'ignore',
]
# pytest-md-report
md_report = true
md_report_verbose = 0
md_report_color = "auto"
# doctest options
doctest_optionflags = [
"ELLIPSIS",
"NORMALIZE_WHITESPACE",
"IGNORE_EXCEPTION_DETAIL",
]
[tool.pytest_env]
REJX_LOG_LEVEL = "INFO" # INFO, WARNING, ERROR, CRITICAL
[tool.mypy]
plugins = []
follow_imports = "silent"
warn_redundant_casts = true
warn_unused_ignores = true
disallow_any_generics = true
check_untyped_defs = true
no_implicit_reexport = true
follow_imports_for_stubs = true
ignore_missing_imports = true
disallow_untyped_defs = true
[tool.pyright]
# https://microsoft.github.io/pyright/#/configuration?id=sample-pyprojecttoml-file
include = ["src"]
exclude = [".venv"]
venvPath = "."
venv = ".venv"
reportInvalidTypeForm = false
[tool.codespell]
# codespell -L 'rejx' -S '.git,.venv,data,.env*,poetry*,*.log,*.csv,*.ipynb,*.html'
skip = ".git,.venv,data,.env*,poetry*,*.log,*.csv,*.ipynb,*.html"
ignore-words-list = 'rejx'
quiet-level = 3
count = true
[tool.poetry.scripts]
rejx = "rejx.__main__:app"
[build-system]
requires = ["poetry-core >= 1.0.0"]
build-backend = "poetry.core.masonry.api"