-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
156 lines (144 loc) · 5.15 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
[tool.poetry]
name = "koerce"
# intentionally 0.0.0; poetry-dynamic-versioning handles the bump
version = "0.0.0"
description = "Python Pattern Matching"
authors = ["Krisztian Szucs <[email protected]>"]
license = "Apache-2.0"
readme = "README.md"
include = [
{ path = "koerce/*.so", format = [ "wheel" ] },
{ path = "koerce/*.dll", format = [ "wheel" ] },
{ path = "koerce/*.lib", format = [ "wheel" ] },
{ path = "koerce/*.pyd", format = [ "wheel" ] },
{ path = "koerce/*.dylib", format = [ "wheel" ] },
]
# exclude = [
# { path = "koerce/builders.py", format = ["wheel"] },
# { path = "koerce/patterns.py", format = ["wheel"] },
# ]
[tool.poetry.dependencies]
python = ">=3.8"
typing-extensions = "^4.12.2"
[tool.poetry.group.dev.dependencies]
cython = "^3.0.10"
pytest = "^8.3.1"
pytest-benchmark = "^4.0.0"
[tool.poetry-dynamic-versioning]
enable = true
[build-system]
requires = [
"poetry-core>=1.8",
"setuptools",
"cython>=3",
"poetry-dynamic-versioning>=1.0.0,<2.0.0",
]
build-backend = "poetry_dynamic_versioning.backend"
[tool.poetry.build]
script = "build.py"
generate-setup-file = false
[tool.ruff]
respect-gitignore = true
exclude = []
target-version = "py310"
[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # comprehensions
"D", # pydocstyle
"E", # pycodestyle
"EXE", # flake8-executable
"F", # pyflakes
"FA", # flake8-future-annotations
"G", # flake8-logging-format
"FLY", # flynt (format string conversion)
"I", # isort
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420 (implicit namespace packages)
"ISC", # flake8-implicit-str-concat
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"RET", # flake8-return
"RUF", # ruff-specific rules
"SIM", # flake8-simplify
"T10", # flake8-debugger
"T20", # flake8-print
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle
"YTT", # flake8-2020
"S", # flake8-bandit
]
ignore = [
"B028", # required stacklevel argument to warn
"B904", # raise from e or raise from None in exception handlers
"B905", # zip-without-explicit-strict
"C408", # dict(...) as literal
"D100", # public module
"D101", # public class
"D102", # public method
"D103", # public function
"D104", # public package
"D105", # magic methods
"D106", # nested class
"D107", # init
"D202", # blank lines after function docstring
"D203", # blank line before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D401", # Imperative mood
"D402", # First line should not be the function's signature
"D413", # Blank line required after last section
"E501", # line-too-long, this is automatically enforced by ruff format
"E731", # lambda-assignment
"ISC001", # single line implicit string concat, handled by ruff format
"PGH003", # blanket-type-ignore
"PLC0105", # covariant type parameters should have a _co suffix
"PLR0124", # name compared with self, e.g., a == a
"PLR0911", # too many return statements
"PLR0912", # too many branches
"PLR0913", # too many arguments
"PLR0915", # too many statements
"PLR2004", # forces everything to be a constant
"PLW2901", # overwriting loop variable
"RET504", # unnecessary-assign, these are useful for debugging
"RET505", # superfluous-else-return, stylistic choice
"RET506", # superfluous-else-raise, stylistic choice
"RET507", # superfluous-else-continue, stylistic choice
"RET508", # superfluous-else-break, stylistic choice
"RUF005", # splat instead of concat
"RUF018", # Avoid assignment expressions in `assert` statements
"SIM102", # nested ifs
"SIM108", # convert everything to ternary operator
"SIM114", # combine `if` branches using logical `or` operator
"SIM116", # dictionary instead of `if` statements
"SIM117", # nested with statements
"SIM118", # remove .keys() calls from dictionaries
"SIM300", # yoda conditions
"UP007", # Optional[str] -> str | None
"UP006", # Use `dict` instead of `Dict` for type annotation
"UP038", # non-pep604-isinstance, results in slower code
"S101", # ignore "Use of `assert` detected"
"TCH003", # Move standard library import `collections.abc.Callable` into a type-checking block
]
# none of these codes will be automatically fixed by ruff
unfixable = [
"T201", # print statements
"F401", # unused imports
"RUF100", # unused noqa comments
"F841", # unused variables
]
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.per-file-ignores]
"*test*.py" = [
"D", # ignore all docstring lints in tests
"UP035", # `typing.List` is deprecated, use `list` instead
"E731", # Do not assign a `lambda` expression, use a `def`
"S301", # pickle is allowed in tests
]
"build.py" = ["I001"] # because of distutils hacking happening in cython
[tool.ruff.format]
docstring-code-format = true