Skip to content

Commit b4fead3

Browse files
committed
update pyproject for new ruff config and no-package setting
1 parent fc313aa commit b4fead3

File tree

1 file changed

+79
-8
lines changed

1 file changed

+79
-8
lines changed

pyproject.toml

Lines changed: 79 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ authors = [
99
]
1010
license = "MPL2.0"
1111
readme = "README.md"
12+
package-mode = false
1213

1314
[tool.poetry.dependencies]
1415
python = "^3.11"
@@ -34,44 +35,114 @@ target-version = "py311"
3435

3536
[tool.ruff.lint]
3637
select = [
38+
"A",
39+
"ANN",
40+
"ASYNC",
41+
"B",
42+
"BLE",
3743
"C4",
44+
"COM",
45+
"DTZ",
46+
"E",
47+
"EM",
48+
"ERA",
3849
"F",
50+
"FA",
51+
"FBT",
52+
"FURB",
3953
"G",
4054
"I",
55+
"INP",
56+
"ISC",
57+
"NPY",
58+
"PD",
59+
"PERF",
60+
"PGH",
61+
"PIE",
62+
"PLC",
63+
"PLE",
64+
"PLW",
4165
"PTH",
66+
"PYI",
67+
"Q",
68+
"Q003",
69+
"RET",
70+
"RSE",
4271
"RUF",
72+
"S",
4373
"SIM",
44-
"TCH",
74+
"SLOT",
75+
"T20",
76+
"TC",
77+
"TID",
78+
"TRY",
4579
"UP",
46-
"W",
47-
"PERF",
48-
"ANN",
80+
"YTT",
81+
# "DOC", # not in a bot, please
4982
]
5083
ignore = [
84+
"ANN401",
85+
"ASYNC109", # dpy commonly uses this parameter
86+
"EM101", # in this case this is okay
5187
"F401",
5288
"F402",
5389
"F403",
5490
"F405",
91+
"INP001", # due to how I load modules this results in annoyances
92+
"PD011", # this is not a numpy codebase
5593
"PERF203",
94+
"PLC0414", # pyright ruling for `as` imports needed
95+
"Q000",
5696
"RUF001",
5797
"RUF009",
98+
"S101", # assert is used for type checking in this codebase
5899
"SIM105",
100+
"TRY003", # over-eager rule
101+
"TRY301", # unrealistic rule
59102
"UP034",
60103
"UP038",
61-
"ANN101",
62-
"ANN102",
63-
"ANN401",
64104
]
105+
unfixable = [
106+
"E501", # line length handled in other ways by ruff format
107+
"ERA", # Don't delete commented out code
108+
]
109+
110+
[tool.ruff.format]
111+
# Like Black, use double quotes for strings.
112+
quote-style = "double"
113+
# Like Black, indent with spaces, rather than tabs.
114+
indent-style = "space"
115+
# Like Black, respect magic trailing commas.
116+
skip-magic-trailing-comma = false
117+
# Like Black, automatically detect the appropriate line ending.
118+
line-ending = "auto"
65119

66120
[tool.ruff.lint.isort]
67121
split-on-trailing-comma = true
68122
combine-as-imports = true
69123

124+
[tool.ruff.lint.pydocstyle]
125+
convention = "numpy"
126+
70127
[tool.ruff.lint.flake8-annotations]
71128
allow-star-arg-any = true
72129

130+
[tool.ruff.lint.flake8-pytest-style]
131+
fixture-parentheses = false
132+
mark-parentheses = false
133+
parametrize-names-type = "csv"
134+
73135
[tool.ruff.lint.flake8-quotes]
74-
inline-quotes = "single"
136+
inline-quotes = "double"
137+
138+
[tool.ruff.lint.flake8-tidy-imports.banned-api]
139+
# https://discuss.python.org/t/problems-with-typeis/55410/6
140+
# https://discuss.python.org/t/problems-with-typeis/55410/46
141+
# Until what can go into a TypeIs/TypeGuard changes, these are just dangerous.
142+
"typing.TypeIs".msg = "TypeIs is fundamentally unsafe, even when using it as described to be safe"
143+
"typing.TypeGuard".msg = "TypeGuard is fundamentally unsafe"
144+
"typing_extensions.TypeIs".msg = "TypeIs is fundamentally unsafe, even when using it as described to be safe"
145+
"typing_extensions.TypeGuard".msg = "TypeGuard is fundamentally unsafe"
75146

76147
[tool.pyright]
77148
useLibraryCodeForTypes = true

0 commit comments

Comments
 (0)