-
Notifications
You must be signed in to change notification settings - Fork 84
/
pyproject.toml
179 lines (159 loc) · 4.02 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
[metadata]
license_file = "LICENSE"
description-file = "README.md"
[build-system]
requires = [
"setuptools",
"wheel",
]
[tool.check-manifest]
ignore = [
"*.yml",
".github",
".github/*"
]
[tool.pytest.ini_options]
norecursedirs = [
".git",
".github",
"dist",
"build",
"docs",
]
addopts = [
"--strict-markers",
"--doctest-modules",
"--color=yes",
"--disable-pytest-warnings",
"--benchmark-timer=torch.utils.benchmark.utils.timer.timer",
"--benchmark-warmup=on",
]
markers = [
"standalone: mark a test as standalone",
]
filterwarnings = [
"error::FutureWarning",
]
timeout = 900
# xfail_strict = true # todo
junit_duration_report = "call"
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"pass",
]
[tool.codespell]
# Todo: enable also python files in a next step
# Gives false positives in fsdp_tutorial.ipynb
skip = '*.py,*fsdp_tutorial.ipynb,*extend_thunder_with_cuda_python.ipynb'
quiet-level = 3
# comma separated list of words; waiting for:
# https://github.com/codespell-project/codespell/issues/2839#issuecomment-1731601603
# also adding links until they ignored by its: nature
# https://github.com/codespell-project/codespell/issues/2243#issuecomment-1732019960
# documen is used in an url in README
ignore-words-list = """
documen, \
te
"""
[tool.black]
# https://github.com/psf/black
line-length = 120
target-version = ['py310']
[tool.isort]
known_first_party = [
"thunder",
"tests"
]
skip_glob = []
profile = "black"
line_length = 120
[tool.ruff]
line-length = 120
# Always generate Python 3.10-compatible code.
target-version = "py310"
# Enable Pyflakes `E` and `F` codes by default.
select = [
"E", "W", # see: https://pypi.org/project/pycodestyle
"F", # see: https://pypi.org/project/pyflakes
# "D", # see: https://pypi.org/project/pydocstyle
# "N", # see: https://pypi.org/project/pep8-naming
]
#extend-select = [
# "C4", # see: https://pypi.org/project/flake8-comprehensions
# "PT", # see: https://pypi.org/project/flake8-pytest-style
# "RET", # see: https://pypi.org/project/flake8-return
# "SIM", # see: https://pypi.org/project/flake8-simplify
#]
ignore = [
"E731", # Do not assign a lambda expression, use a def
"E501", # todo: Line too long (235 > 120 characters)
]
# Exclude a variety of commonly ignored directories.
exclude = [
".eggs",
".git",
".mypy_cache",
".ruff_cache",
"__pypackages__",
"_build",
"build",
"dist",
"docs"
]
ignore-init-module-imports = true
[tool.ruff.per-file-ignores]
"setup.py" = ["D100", "SIM115"]
"__about__.py" = ["D100"]
"__init__.py" = ["D100"]
[tool.ruff.pydocstyle]
# Use Google-style docstrings.
convention = "google"
#[tool.ruff.pycodestyle]
#ignore-overlong-task-comments = true
[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.mypy]
files = [
"thunder",
]
install_types = true
non_interactive = true
disallow_untyped_defs = true
ignore_missing_imports = true
show_error_codes = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
allow_redefinition = true
# disable this rule as the Trainer attributes are defined in the connectors, not in its __init__
disable_error_code = "attr-defined"
# style choices
warn_no_return = false
# Ignore mypy errors for these files
# TODO: the goal is for this to be empty
[[tool.mypy.overrides]]
module = [
"thunder",
"thunder.core.dtypes",
"thunder.langs.torch",
"thunder.core.lang",
"thunder.core.prims",
"thunder.core.proxies",
"thunder.core.trace",
"thunder.core.transforms",
"thunder.core.utils",
"thunder.executors.nvfuser",
"thunder.executors.torch",
"thunder.tests.framework",
"thunder.tests.nanogpt_model",
"thunder.tests.opinfos",
"thunder.tests.test_core",
"thunder.tests.test_elementwise",
"thunder.tests.test_networks",
"thunder.tests.test_ops",
"thunder.tests.test_reductions",
"thunder.tests.test_script",
]
ignore_errors = "True"