-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
282 lines (263 loc) · 8.1 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
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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = 'tjax'
version = "1.1.0"
description = 'Tools for JAX.'
readme = 'README.rst'
requires-python = '>=3.11,<3.14'
license = {file = 'LICENSE'}
authors = [{email = '[email protected]'}, {name = 'Neil Girdhar'}]
maintainers = [{email = '[email protected]'}, {name = 'Neil Girdhar'}]
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities',
'Typing :: Typed',
'License :: OSI Approved :: MIT License',
]
dependencies = [
'array_api_compat >= 1.6',
'rich >= 13.7',
'jax >= 0.4.27',
'numpy >= 1.24',
'optax >= 0.2.3',
'typing_extensions >= 4.11',
]
[project.urls]
repository = 'https://github.com/NeilGirdhar/tjax'
[tool.uv]
dev-dependencies = [
'chex >= 0.1.3',
'flax >= 0.10',
'isort >= 5.11',
'jupyter >= 1',
'mypy >= 1.12',
'networkx >= 3.0',
'pylint >= 3.3.1',
'pyright >= 0.0.13',
'pytest >= 8',
'ruff >= 0.7',
]
[tool.isort]
line_length = 100
multi_line_output = 0
skip_glob = ['.pytype/*.py']
[tool.pytest]
[tool.pytype]
disable = 'ignored-abstractmethod'
[tool.pylint.master]
jobs = 0
py-version = '3.11'
load-plugins = [
'pylint.extensions.bad_builtin',
'pylint.extensions.broad_try_clause',
'pylint.extensions.check_elif',
'pylint.extensions.code_style',
'pylint.extensions.comparison_placement',
'pylint.extensions.confusing_elif',
'pylint.extensions.consider_refactoring_into_while_condition',
'pylint.extensions.consider_ternary_expression',
'pylint.extensions.dict_init_mutate',
'pylint.extensions.docparams',
'pylint.extensions.docstyle',
'pylint.extensions.dunder',
'pylint.extensions.empty_comment',
'pylint.extensions.eq_without_hash',
'pylint.extensions.for_any_all',
'pylint.extensions.magic_value',
'pylint.extensions.mccabe',
'pylint.extensions.no_self_use',
'pylint.extensions.overlapping_exceptions',
'pylint.extensions.private_import',
'pylint.extensions.redefined_loop_name',
'pylint.extensions.redefined_variable_type',
'pylint.extensions.set_membership',
'pylint.extensions.typing',
'pylint.extensions.while_used',
]
[tool.pylint.messages_control]
disable = [
'abstract-method',
'arguments-differ',
'bad-dunder-name',
'confusing-consecutive-elif',
'consider-using-assignment-expr',
'consider-using-tuple',
'cyclic-import',
'duplicate-code',
'empty-comment',
'fixme',
'import-outside-toplevel',
'invalid-field-call',
'invalid-name',
'invalid-unary-operand-type',
'line-too-long',
'keyword-arg-before-vararg',
'magic-value-comparison',
'missing-docstring',
'no-member',
'no-self-use',
'not-callable',
'protected-access',
'redefined-builtin',
'redefined-outer-name',
'redefined-variable-type',
'signature-differs',
'too-complex',
'too-few-public-methods',
'too-many-ancestors',
'too-many-arguments',
'too-many-branches',
'too-many-instance-attributes',
'too-many-locals',
'too-many-positional-arguments',
'too-many-return-statements',
'too-many-statements',
'too-many-try-statements',
'unexpected-keyword-arg',
'ungrouped-imports',
'unused-argument',
'unused-import',
'use-set-for-membership',
'while-used',
]
enable = [
'useless-suppression',
'use-symbolic-message-instead',
]
[tool.pylint.reports]
output-format = 'colorized'
[tool.pylint.similarities]
min-similarity-lines = 10
ignore-imports = 'yes'
[tool.pyright]
include = ['tjax', 'tests']
stubPath = ''
venvPath = '.'
venv = '.venv'
enableTypeIgnoreComments = false
reportImportCycles = true
reportCallInDefaultInitializer = true
reportConstantRedefinition = true
reportDeprecated = true
reportDuplicateImport = true
reportImplicitOverride = true
reportImplicitStringConcatenation = false
reportIncompatibleMethodOverride = true
reportIncompatibleVariableOverride = true
reportInconsistentConstructor = true
reportMatchNotExhaustive = true
reportMissingParameterType = true
reportMissingSuperCall = true
reportMissingTypeArgument = true
reportOverlappingOverload = true
reportPrivateImportUsage = true
reportPropertyTypeMismatch = true
reportShadowedImports = true
reportUninitializedInstanceVariable = true
reportUnknownArgumentType = false
reportUnknownLambdaType = false
reportUnknownMemberType = false
reportUnknownParameterType = false
reportUnknownVariableType = false
reportUnnecessaryCast = true
reportUnnecessaryComparison = true
reportUnnecessaryContains = true
reportUnnecessaryIsInstance = true
reportUnnecessaryTypeIgnoreComment = true
reportUntypedBaseClass = true
reportUntypedClassDecorator = true
reportUntypedFunctionDecorator = true
reportUntypedNamedTuple = true
reportUnusedCallResult = false
reportUnusedClass = true
reportUnusedExpression = true
reportUnusedFunction = true
reportUnusedVariable = true
[tool.mypy]
files = ['tjax', 'tests']
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
no_implicit_optional = true
pretty = true
show_error_codes = true
show_error_context = true
strict_equality = true
warn_no_return = true
warn_redundant_casts = true
# warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[[tool.mypy.overrides]]
module = ['networkx', 'optax', 'optax.contrib', 'array_api_compat']
ignore_missing_imports = true
[tool.ruff]
line-length = 100
[tool.ruff.lint]
preview = true
select = ['ALL']
ignore = [
'ANN101', # Missing type annotation for self.
'ANN102', # Missing type annotation for cls.
'ANN401', # Dynamically typed expressions (Any).
'ARG001', # Unused function argument.
'ARG002', # Unused method argument.
'ARG003', # Unused class method argument.
'ARG004', # Unused static method argument.
'B011', # Do not assert false.
'C901', # Complex structure.
'COM812', # Trailing comma missing.
'CPY001', # Missing copyright.
'D100', # Missing docstring in public module.
'D101', # Missing docstring in public class.
'D102', # Missing docstring in public method.
'D103', # Missing docstring in public function.
'D105', # Missing docstring in magic method.
'D107', # Missing docstring in __init__.
'DOC201', # return is not documented in docstring.
'DOC202', # Docstring should not have a returns section because the function doesn't return anything.
'DOC402', # DOC402 `yield` is not documented in docstring.
'DOC501', # Raised exception `ValueError` missing from docstring.
'ERA001', # Commented-out code.
'FBT003', # Boolean positional value in function call.
'FIX002', # Line contains TODO, consider resolving the issue.
'G004', # Logging statement uses f-string.
'I001', # Import block is un-sorted or un-formatted.
'PD008', # Use .loc instead of .at. If speed is important, use NumPy.
'PGH003', # Use specific rule codes when ignoring type issues.
'PLR0913', # Too many arguments in function definition.
'PLR6301', # Method doesn't use self.
'PT013', # Found incorrect import of pytest, use simple import pytest instead.
'Q000', # Single quotes found but double quotes preferred.
'RUF021', # Parenthesize `a and b` expressions when chaining `and` and `or` together...
'S101', # Assert used.
'TCH001', # Move application import into a type-checking block.
'TCH002', # Move third-party import into a type-checking block.
'TCH003', # Move standard library import into a type-checking block.
'TD002', # Missing author in TODO; try: # TODO(<author_name>): ....
'TD003', # Missing issue link on the line following this TODO.
'TID252', # Relative imports from parent modules are banned.
]
[tool.ruff.lint.flake8-errmsg]
max-string-length = 40
[tool.ruff.lint.isort]
combine-as-imports = true
[tool.ruff.lint.pydocstyle]
convention = 'google'
[tool.ruff.lint.pylint]
max-args = 8