-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
213 lines (188 loc) · 6.16 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
[tool.poetry]
authors=["Alan Cooney <41682961+alan-cooney@users.noreply.github.com>"]
description=""
include=["src"]
license="MIT"
name="src"
readme="README.md"
version="0.0.0"
[tool.poetry.dependencies]
circuitsvis=">=1.43.2"
einops=">=0.7"
python=">=3.10, <3.12"
torch=">=2.1.1"
transformer-lens=">=1.11.0"
[tool.poetry.group.dev.dependencies]
plotly=">=5"
poethepoet=">=0.24.2"
pydoclint=">=0.3.8"
pyright=">=1.1.339"
pytest=">=7"
pytest-cov=">=4"
pytest-timeout=">=2.2.0"
ruff=">=0.1.4"
syrupy=">=4.6.0"
[tool.poetry.group.jupyter.dependencies]
ipywidgets=">=8.1.1"
jupyterlab=">=4"
[tool.poe.tasks]
[tool.poe.tasks.check]
help="All checks"
ignore_fail=false
sequence=["check-lock", "docstring-lint", "format", "lint", "test", "typecheck"]
[tool.poe.tasks.format]
cmd="ruff format ."
help="Format code (with autofix)"
[tool.poe.tasks.lint]
cmd="ruff check . --fix"
help="Lint (with autofix)"
[tool.poe.tasks.docstring-lint]
cmd="pydoclint ."
help="Lint docstrings"
[tool.poe.tasks.ruff]
help=" [alias for lint && format]"
ignore_fail=false
sequence=["format", "lint"]
[tool.poe.tasks.check-lock]
cmd="poetry check"
help="Check the Poetry lockfile"
[tool.poe.tasks.snapshot-update]
cmd="pytest --snapshot-update"
help="Update test snapshots"
[tool.poe.tasks.test]
cmd="pytest"
help="Run tests"
[tool.poe.tasks.pytest]
help=" [alias for test]"
sequence=["test"]
[tool.poe.tasks.typecheck]
cmd="pyright"
help="Typecheck"
[tool.poe.tasks.pyright]
help=" [alias for typecheck]"
sequence=["typecheck"]
[build-system]
build-backend="poetry.core.masonry.api"
requires=["poetry-core"]
[tool.pytest]
cache_dir=".cache/pytest"
durations=3
timeout=60
[tool.pytest.ini_options]
addopts=[
"--doctest-modules",
"--jaxtyping-packages=src,beartype.beartype",
"-W ignore::beartype.roar.BeartypeDecorHintPep585DeprecationWarning",
"-s",
]
[tool.ruff]
cache-dir=".cache/ruff"
extend-include=["*.ipynb"]
ignore=[
"ANN101", # self type annotation (it's inferred)
"F722", # Forward annotations check (conflicts with jaxtyping)
"FA102", # Annotations support (Python >= 3.9 is fine)
"INP001", # __init__.py for all packages (Python >= 3.3 is fine)
"PGH003", # No general type: ignore (not supported with pyright)
"TCH002", # Type checking imports (conflicts with beartype)
# Rules that conflict with ruff format
"COM812",
"ISC001",
]
ignore-init-module-imports=true
line-length=100
select=["ALL"]
[tool.ruff.lint]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports="all"
[tool.ruff.lint.flake8-annotations]
mypy-init-return=true
[tool.ruff.lint.isort]
force-sort-within-sections=true
known-third-party=["wandb"]
lines-after-imports=2
[tool.ruff.lint.per-file-ignores]
"**/*.ipynb"=[
"B018", # Useless variables are used for printing
"D100", # No file docstring needed
"E402", # Imports don't need to be at the top
"I001", # Unsorted imports
"T201", # Print is fine
]
"**/tests/*"=[
"ARG001", # Fixtures often have unused arguments
"PT004", # Fixtures don't return anything
"S101", # Assert is needed in PyTest
"TCH001", # Don't need to mark type-only imports
]
[tool.ruff.lint.pydocstyle]
convention="google"
[tool.ruff.lint.pylint]
max-args=10
[tool.pyright]
# All rules apart from base are shown explicitly below
deprecateTypingAliases=true
disableBytesTypePromotions=true
include=["."]
reportAssertAlwaysTrue=true
reportConstantRedefinition=true
reportDeprecated=true
reportDuplicateImport=true
reportFunctionMemberAccess=true
reportGeneralTypeIssues=true
reportIncompatibleMethodOverride=true
reportIncompatibleVariableOverride=true
reportIncompleteStub=true
reportInconsistentConstructor=true
reportInvalidStringEscapeSequence=true
reportInvalidStubStatement=true
reportInvalidTypeVarUse=true
reportMatchNotExhaustive=true
reportMissingParameterType=true
reportMissingTypeArgument=false
reportMissingTypeStubs=false
reportOptionalCall=true
reportOptionalContextManager=true
reportOptionalIterable=true
reportOptionalMemberAccess=true
reportOptionalOperand=true
reportOptionalSubscript=true
reportOverlappingOverload=true
reportPrivateImportUsage=true
reportPrivateUsage=true
reportSelfClsParameterName=true
reportTypeCommentUsage=true
reportTypedDictNotRequiredAccess=true
reportUnboundVariable=true
reportUnknownArgumentType=false
reportUnknownLambdaType=true
reportUnknownMemberType=false
reportUnknownParameterType=false
reportUnknownVariableType=false
reportUnnecessaryCast=true
reportUnnecessaryComparison=true
reportUnnecessaryContains=true
reportUnnecessaryIsInstance=true
reportUnsupportedDunderAll=true
reportUntypedBaseClass=true
reportUntypedClassDecorator=true
reportUntypedFunctionDecorator=true
reportUntypedNamedTuple=true
reportUnusedClass=true
reportUnusedCoroutine=true
reportUnusedExpression=true
reportUnusedFunction=true
reportUnusedImport=true
reportUnusedVariable=true
reportWildcardImportFromLibrary=true
strictDictionaryInference=true
strictListInference=true
strictParameterNoneValue=true
strictSetInference=true
[tool.pydoclint]
allow-init-docstring=true
arg-type-hints-in-docstring=false
check-return-types=false
check-yield-types=false
exclude='\.venv'
style="google"