-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
236 lines (202 loc) · 8.09 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
[tool.poetry]
name = "syml"
version = "0.6.2"
description = "SYML (Simple YAML-like Markup Language) is a simple markup language with similar structure to YAML, but without all the gewgaws and folderol."
authors = ["David Eyk <[email protected]>"]
homepage = "https://github.com/eykd/syml/"
repository = "https://github.com/eykd/syml"
license = "MIT"
readme = "README.md"
packages = [{include = "syml", from = "src"}]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing :: Markup",
]
[tool.poetry.dependencies]
python = "^3.12"
parsimonious = "^0.10.0"
regex = "^2024.11.6"
[tool.poetry.group.dev.dependencies]
ipython = "^8.27.0"
pre-commit = "^3.8.0"
when-changed = "^0.3.0"
[tool.poetry.group.test.dependencies]
pytest = "^8.3.2"
ruff = "^0.6.3"
pytest-cov = "^5.0.0"
pytest-random-order = "^1.1.1"
mypy = "^1.11.2"
pytest-ruff = "^0.4.1"
pytest-mypy = "^0.10.3"
pydantic = "^2.8.2"
types-parsimonious = "^0.10.0.20240331"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
# Python linter & formatter
# https://docs.astral.sh/ruff/
line-length = 120
src = ["src"]
target-version = "py312"
[tool.ruff.lint]
preview = true
# https://docs.astral.sh/ruff/rules/
select = [
"A", # https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"ANN", # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ARG", # https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
"ASYNC", # https://docs.astral.sh/ruff/rules/#flake8-async-async
"B", # https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"BLE", # https://docs.astral.sh/ruff/rules/#flake8-blind-except-ble
"C4", # https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"C90", # https://docs.astral.sh/ruff/rules/#mccabe-c90
"COM", # https://docs.astral.sh/ruff/rules/#flake8-commas-com
"D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d
"DTZ", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"E", # https://docs.astral.sh/ruff/rules/#error-e
"EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"ERA", # https://docs.astral.sh/ruff/rules/#eradicate-era
"EXE", # https://docs.astral.sh/ruff/rules/#flake8-executable-exe
"F", # https://docs.astral.sh/ruff/rules/#pyflakes-f
"FA", # https://docs.astral.sh/ruff/rules/#flake8-future-annotations-fa
"FBT", # https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
"FLY", # https://docs.astral.sh/ruff/rules/#flynt-fly
"FURB", # https://docs.astral.sh/ruff/rules/#refurb-furb
"G", # https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"I", # https://docs.astral.sh/ruff/rules/#isort-i
"ICN", # https://docs.astral.sh/ruff/rules/#flake8-import-conventions-icn
"INP", # https://docs.astral.sh/ruff/rules/#flake8-no-pep420-inp
"INT", # https://docs.astral.sh/ruff/rules/#flake8-gettext-int
"ISC", # https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc
"LOG", # https://docs.astral.sh/ruff/rules/#flake8-logging-log
"N", # https://docs.astral.sh/ruff/rules/#pep8-naming-n
"PERF", # https://docs.astral.sh/ruff/rules/#perflint-perf
"PGH", # https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
"PIE", # https://docs.astral.sh/ruff/rules/#flake8-pie-pie
# "PL", # https://docs.astral.sh/ruff/rules/#pylint-pl
"PT", # https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"PTH", # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"PYI", # https://docs.astral.sh/ruff/rules/#flake8-pyi-pyi
"Q", # https://docs.astral.sh/ruff/rules/#flake8-quotes-q
"RET", # https://docs.astral.sh/ruff/rules/#flake8-return-ret
"RSE", # https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"S", # https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"SLF", # https://docs.astral.sh/ruff/rules/#flake8-self-slf
"SLOT", # https://docs.astral.sh/ruff/rules/#flake8-slots-slot
"T10", # https://docs.astral.sh/ruff/rules/#flake8-debugger-t10
"T20", # https://docs.astral.sh/ruff/rules/#flake8-print-t20
"TCH", # https://docs.astral.sh/ruff/rules/#flake8-type-checking-tch
"TD", # https://docs.astral.sh/ruff/rules/#flake8-todos-td
"TID", # https://docs.astral.sh/ruff/rules/#flake8-tidy-imports-tid
"TRY", # https://docs.astral.sh/ruff/rules/#tryceratops-try
"UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up
"W", # https://docs.astral.sh/ruff/rules/#warning-w
"YTT", # https://docs.astral.sh/ruff/rules/#flake8-2020-ytt
]
ignore = [
"COM812", # https://docs.astral.sh/ruff/rules/missing-trailing-comma/
"D105", # https://docs.astral.sh/ruff/rules/undocumented-magic-method/
"D106", # https://docs.astral.sh/ruff/rules/undocumented-public-nested-class/
"D107", # https://docs.astral.sh/ruff/rules/undocumented-public-init/
"D203", # https://docs.astral.sh/ruff/rules/one-blank-line-before-class/
"D213", # https://docs.astral.sh/ruff/rules/multi-line-summary-second-line/
"D400", # https://docs.astral.sh/ruff/rules/ends-in-period/
"D401", # https://docs.astral.sh/ruff/rules/non-imperative-mood/
"D404", # https://docs.astral.sh/ruff/rules/docstring-starts-with-this/
"D415", # https://docs.astral.sh/ruff/rules/ends-in-punctuation/
"E501", # https://docs.astral.sh/ruff/rules/line-too-long/
"EM101", # https://docs.astral.sh/ruff/rules/raw-string-in-exception/
"ISC001", # https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/
"TRY003", # https://docs.astral.sh/ruff/rules/raise-vanilla-args/
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"S101",
"D1",
"INP001",
"ARG001",
]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
inline-quotes = "single"
[tool.ruff.format]
preview = true
quote-style = "single"
docstring-code-format = true
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.pytest.ini_options]
# The best Python test runner
# https://docs.pytest.org/en/latest/contents.html
addopts = [
"--cov",
"--cov-report=term:skip-covered",
"--no-cov-on-fail",
"--strict-markers",
"--strict-config",
"--random-order",
"-vv",
]
markers = [
# If you have slow tests that you want to exclude, mark them like so:
# @pytest.mark.slow
# def test_my_slow_test():
# # ...
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]
[tool.coverage.run]
# Python test coverage tool
# https://coverage.readthedocs.io/
plugins = [
]
branch = true
source = ['src']
omit = [
'*/test*.py',
'*/conftest.py',
]
[tool.coverage.report]
show_missing = true
[tool.mypy]
# Python type checking
# https://www.mypy-lang.org/
# Mypy configuration:
# https://mypy.readthedocs.io/en/stable/config_file.html
# pyproject.toml, specifically:
# https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file
mypy_path = "./src:./tests"
files = ["./tests/**/*.py", "./src/**/*.py"]
plugins = [
"pydantic.mypy",
]
follow_imports = "silent"
warn_redundant_casts = true
warn_unused_ignores = true
disallow_any_generics = true
check_untyped_defs = true
no_implicit_reexport = true
# for strict mypy: (this is the tricky one :-))
disallow_untyped_defs = true
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
[[tool.mypy.overrides]]
module = ["pytest"]
ignore_missing_imports = true
[tool.isort]
# Python import sorter
# https://pycqa.github.io/isort/
profile = "black"