-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
255 lines (230 loc) · 6.95 KB
/
pyproject.toml
File metadata and controls
255 lines (230 loc) · 6.95 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
[project]
name = "pybmoore"
version = "2.2.0"
description = "Python/Cython implementation of Boyer-Moore string-search algorithm"
authors = [
{ name = "Alexandre Menezes", email = "alexandre.fmenezes@gmail.com" }
]
license = "Apache-2.0"
readme = "README.md"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Cython",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules"
]
keywords = ["search", "boyer-moore", "text-search"]
requires-python = ">=3.10"
[tool.setuptools]
packages = ["pybmoore"]
[dependency-groups]
dev = [
"Cython",
"mypy",
"ruff",
"pytest",
"pytest-cov",
"coverage",
"pytest-asyncio",
"pre-commit",
"radon",
"bandit",
"cibuildwheel",
]
docs = [
"mkdocs-material"
]
benchmark = [
"pytest-benchmark"
]
all = [
{include-group = "docs"},
{include-group = "benchmark"},
]
# configuração para fins de compatibilidade
[project.optional-dependencies]
dev = [
"mypy",
"ruff",
"pytest",
"pytest-cov",
"coverage",
"pytest-asyncio",
"pre-commit",
"radon",
"bandit",
]
docs = [
"mkdocs-material"
]
benchmark = [
"pytest-benchmark"
]
# Para o grupo 'all', precisa expandir manualmente (sem herança)
all = [
"mkdocs-material",
"pytest-benchmark"
]
[project.urls]
Documentation = "https://github.com/amenezes/pybmoore"
Code = "https://github.com/amenezes/pybmoore"
Issue-tracker = "https://github.com/amenezes/pybmoore/issues"
Changes = "https://github.com/amenezes/pybmoore/releases"
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
filterwarnings = ["ignore::pytest.PytestUnraisableExceptionWarning"]
[tool.ruff]
# https://docs.astral.sh/ruff/settings/
target-version = "py313"
line-length = 88
indent-width = 4
unsafe-fixes = false
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".venv",
".vscode",
"__pycache__",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
"*.pyc",
]
[tool.ruff.lint]
# https://docs.astral.sh/ruff/rules/
select = [
"A", # flake8-builtins - prevent using keywords that clobber python builtins
"B", # flake8-bugbear - find likely bugs and design problems
"C4", # flake8-comprehensions - better list/set/dict comprehensions
"E", # pycodestyle errors
"F", # pyflakes - undefined names, unused imports
"I", # isort - import sorting
"N", # pep8-naming - naming conventions
"PERF", # perflint - performance anti-patterns
"PIE", # flake8-pie - misc lints
"PTH", # flake8-use-pathlib - use pathlib instead of os.path
"RET", # flake8-return - improve return statements
"RUF", # ruff-specific rules
"S", # flake8-bandit - security testing
"SIM", # flake8-simplify - simplify code
"UP", # pyupgrade - upgrade syntax for newer python versions
"W", # pycodestyle warnings
]
ignore = [
"E501", # line-too-long (handled by formatter)
"S101", # assert-used (pytest uses asserts)
"S301", # pickle usage (required for serialization)
"S311", # pseudo-random generator (scripts/testing context)
"S603", # subprocess-without-shell-equals-true
"S607", # start-process-with-partial-path
"N806", # non-lowercase-variable-in-function (allow df, X, y in data science)
"N818", # exception naming (legacy exceptions)
"UP028", # yield from (readability preference)
"PTH123", # pathlib over builtin open (gradual migration)
"B019", # lru_cache on methods (acceptable for simple cases)
"B026", # star-arg unpacking (library API requirement)
"B904", # raise from (legacy exception handling)
"C408", # dict() calls (style preference)
"C416", # list comprehensions (readability preference)
"C417", # map usage (functional programming style)
"B007", # unused loop variables (scripts context)
"A001", # shadowing builtins (test context)
"RUF015", # single element slice (readability)
"RET504", # unnecessary assignment (clarity preference)
"SIM103", # negated condition (readability)
"SIM118", # dict.keys() (compatibility)
"PERF401",# list comprehension performance (readability)
"UP035", # Import from collections.abc instead
"B015",
"W291",
"E261",
"RUF001",
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = [
"PLR2004", # magic-value-comparison
"S101", # assert-used
"TID252", # relative-imports
]
# Scripts can have more flexibility
"scripts/**/*" = [
"T20", # print statements
"S101", # assert-used
]
[tool.ruff.lint.flake8-bandit]
check-typed-exception = true
hardcoded-tmp-directory = ["/tmp", "/var/tmp", "/dev/shm"]
[tool.ruff.lint.isort]
case-sensitive = false
split-on-trailing-comma = true
force-single-line = false
known-first-party = ["strf-llm"]
[tool.ruff.lint.pep8-naming]
# Allow Pydantic's `@validator` decorator to trigger class method treatment.
classmethod-decorators = ["classmethod", "pydantic.validator", "pydantic.root_validator"]
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
[tool.mypy]
platform = "linux"
files = ["pybmoore"]
show_error_context = true
verbosity = 0
ignore_missing_imports = true
no_implicit_optional = true
warn_unused_configs = true
warn_return_any = true
warn_unused_ignores = true
warn_unreachable = true
[build-system]
requires = ["setuptools>=61.0", "wheel", "Cython>=3.0"]
build-backend = "setuptools.build_meta"
[tool.cibuildwheel]
build = "cp310-* cp311-* cp312-* cp313-* cp314-*"
skip = "*-win32 *-manylinux_i686"
archs = ["auto64"]
[tool.cibuildwheel.linux]
archs = ["x86_64", "aarch64"]
[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
[tool.cibuildwheel.windows]
archs = ["AMD64"]