-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
216 lines (188 loc) · 5.18 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
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "polymatch"
dynamic = ["version"]
description = "A polymorphic pattern matching library for Python"
readme = "README.md"
license = "MIT"
requires-python = ">=3.8"
authors = [{ name = "linuxdaemon", email = "linuxdaemon.irc@gmail.com" }]
keywords = ["library", "pattern-matching", "utility", "regex"]
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3 :: Only",
"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",
]
dependencies = ["typing-extensions", "regex"]
[project.urls]
Homepage = "https://github.com/TotallyNotRobots/polymatch"
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.targets.sdist]
exclude = ["/.github"]
[tool.hatch.build.targets.wheel]
packages = ["polymatch"]
[tool.hatch.build.hooks.vcs]
version-file = "polymatch/_version.py"
[tool.hatch.envs.default]
dependencies = [
"coverage[toml]>=6.5",
"pytest>=6.0",
"pre-commit",
"mypy>=1.8",
"types-regex",
"ruamel.yaml",
]
[tool.hatch.envs.default.scripts]
setup-dev = ["hatch run pre-commit install"]
fix-pre-commit = ["hatch run python3 -m scripts.fix_pre_commit"]
[tool.hatch.envs.hatch-test]
default-args = ["tests", "polymatch"]
extra-args = ["-vv"]
[tool.hatch.envs.hatch-test.scripts]
run = "pytest{env:HATCH_TEST_ARGS:} {args}"
run-cov = "coverage run -m pytest{env:HATCH_TEST_ARGS:} {args}"
cov-combine = "coverage combine"
cov-report = ["coverage report --show-missing --skip-covered", "coverage xml"]
[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.12", "3.11", "3.10", "3.9", "3.8"]
[tool.hatch.envs.types]
extra-dependencies = ["mypy>=1.0.0"]
[tool.hatch.envs.types.scripts]
check = "mypy --install-types --non-interactive {args:polymatch tests}"
[tool.isort]
profile = "black"
line_length = 80
include_trailing_comma = true
use_parentheses = true
known_first_party = ["polymatch"]
float_to_top = true
[tool.black]
line-length = 80
target-version = ["py38"]
include = '\.pyi?$'
[tool.ruff]
line-length = 80
target-version = 'py38'
[tool.ruff.format]
docstring-code-format = true
line-ending = "lf"
skip-magic-trailing-comma = true
[tool.ruff.lint]
ignore-init-module-imports = false
extend-safe-fixes = [
"EM101",
"EM102",
"EM103",
"FLY002",
"TCH001",
"TCH002",
"TRY400",
"SIM117",
"SIM108",
"ANN201",
"D415",
"D200",
]
ignore = [
"TRY003", # TODO(aspen): Switch to custom exceptions
"ANN101", # Due to be deprecated in ruff
"ANN102", # Due to be deprecated in ruff
"COM812", # Conflicts with formatter
"ISC001", # Conflicts with formatter
"EXE002", # pre-commit does it better, works with SMB shares
"FA100",
]
select = ["ALL"]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = [
"PLR2004", # Allow "magic values" in tests -aspen
"S101", # Allow asserts in tests
"S301", # Allow pickle in tests
"SIM201", # We need to test weird comparison operators
"SIM202", # We need to test weird comparison operstors
"SIM300", # We need to test both forward and reverse comparisons
"FBT001", # Boolean parameters are fine for test cases
]
[tool.ruff.lint.pycodestyle]
max-line-length = 100
[tool.ruff.lint.isort]
split-on-trailing-comma = false
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.flynt]
aggressive = true
transform-joins = true
transform-concats = true
line-length = 120
[tool.mypy]
namespace_packages = true
python_version = "3.8"
warn_unused_configs = true
strict = true
strict_optional = true
check_untyped_defs = true
show_error_codes = true
warn_unused_ignores = true
no_implicit_reexport = true
warn_redundant_casts = true
strict_equality = true
disallow_any_generics = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_untyped_decorators = true
extra_checks = true
warn_unreachable = true
warn_return_any = true
warn_no_return = true
enable_error_code = [
"redundant-self",
"redundant-expr",
"possibly-undefined",
"truthy-bool",
"truthy-iterable",
"ignore-without-code",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--doctest-modules"
testpaths = ["polymatch", "tests"]
filterwarnings = ["error"]
[tool.coverage.paths]
polymatch = [
"polymatch",
"*/polymatch/polymatch",
]
tests = ["tests", "*/polymatch/tests"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.coverage.run]
branch = true
relative_files = true
source_pkgs = ["polymatch", "tests"]
omit = ["polymatch/_version.py"]
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "v$version"
version_scheme = "semver"
version_provider = "scm"
update_changelog_on_bump = true
major_version_zero = true
[tool.nitpick]
style = ["gh://TotallyNotRobots/nitpick/lib-style.toml"]
[tool.check-spdx-header]
headers = ["2018-present linuxdaemon <linuxdaemon.irc@gmail.com>"]