-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
80 lines (75 loc) · 2.88 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
[tool.poetry]
name = "masif2"
version = "0.0.1"
description = ""
authors = ["Roman Knyazhitskiy <[email protected]>"]
license = "MIT"
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
jax = {extras = ["cuda12-pip"], version = "^0.4.30"}
jaxlib = "^0.4.30"
jaxtyping = "^0.2.33"
equinox = "^0.11.4"
pytest = "^8.2.2"
einops = "^0.8.0"
beartype = {version = "^0.19.0rc0", allow-prereleases = true}
optax = "^0.2.3"
chex = "^0.1.86"
tqdm = "^4.66.5"
numpy = "<2.0.0" # openml requires numpy<2.0.0, but they don't specify it
openml = "^0.14.2"
matplotlib = "^3.9.2"
wandb = "^0.17.7"
ijson = "^3.3.0"
[tool.pyright]
# This is poor, but who needs to use pyright, outside of development? Correct: nobody.
venvPath = "."
venv = ".venv"
# The rule of thumb to using ruff: use as much stuff as possible,
# with priority towards lower diffs, and sensibility:
# e.g. using pathlib is weird, but that is a right way to do stuff,
# even though it is slightly too verbose imo, it allows to avoid
# the win/linux issues, which is wonderful.
# So, the policy is "opt out if the rule is dumb".
[tool.ruff]
line-length = 100
[tool.ruff.lint]
select = ["F", "E", "W", "C90", "I", "N", "UP", "YTT", "ASYNC",
"ASYNC1", "S", "FBT", "B", "A", "COM", "C4", "DTZ",
"T10", "DJ", "EM", "EXE", "FA", "ISC", "ICN", "LOG", "G", "INP",
"PIE", "T20", "PYI", "PT", "Q", "RSE", "RET", "SLF", "SLOT", "SIM",
"TID", "INT", "ARG", "PTH", "TD", "FIX", "ERA", "PD",
"PL", "C", "R", "TRY", "FLY", "NPY", "AIR", "RUF"]
# "PTH", "TODO", "FIX", "PGH" are nice, but the severity is too strict
# when ruff allows to user-specify severity, should work out nice with the
# lowest severity
# the "TCH" and "D" families I just hate: TCH forces you to do a bunch of weird
# shit, while D makes you write a lot of comments. While comments (ie docs) are nice,
# enforcing them is not nice
ignore = [
"PYI041", # contradicts adequate typing conventions (beartype compat)
"COM812", # I dislike end commas forcing since it forces multiline which is ugly imo
"INP001", # allow namespace packages
"S101", # allow asserts (tests and invariants)
"B017", # allow pytest.raises(Exception)
"PT011", # don't force match (allow broad exceptions)
"RET504", # allow returning variables that you just assigned, better readability
"FA102", # from __future__ import annotations is useless, py3.10+
"PD008", # jax incompatible
"F821", # jaxtyping incompatible, hope for pyright
"F722", # also jaxtyping incompatible
"B023", # jax incompatible-ish
"PLR2004", # magic values are bad, but necessary in ML
"TD002", # allow simple todos
"TD003",
"FIX002",
"TRY003", # allow to specify long message in excepts
"PLR0913", # machine learning needs lots of arguments
"EM101", # string literals for exceptions are alright
"T100", # allow breakpoints
"T201", # allow print statements
]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"