forked from Lightning-AI/pytorch-lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
229 lines (213 loc) · 7 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
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
[metadata]
name = "pytorch-lightning"
author = "Lightning-AI et al."
url = "https://github.com/Lightning-AI/lightning"
[build-system]
requires = [
"setuptools",
"wheel",
]
[tool.isort]
known_first_party = [
"pl_examples",
"pytorch_lightning",
"lightning_fabric",
"tests_pytorch",
]
profile = "black"
line_length = 120
force_sort_within_sections = "False"
order_by_type = "False"
skip = ["_notebooks"]
[tool.black]
line-length = 120
exclude = '(_notebooks/.*)'
[tool.ruff]
line-length = 120
# Enable Pyflakes `E` and `F` codes by default.
select = [
"E", "W", # see: https://pypi.org/project/pycodestyle
"F", # see: https://pypi.org/project/pyflakes
]
ignore = [
"E731", # Do not assign a lambda expression, use a def
]
# Exclude a variety of commonly ignored directories.
exclude = [
".git",
"docs",
"_notebooks"
]
ignore-init-module-imports = true
[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.mypy]
files = [
"src/lightning",
"src/pytorch_lightning",
]
# This section is for folders with "-" as they are not valid python modules
exclude = [
"src/lightning/app/cli/app-template",
"src/lightning/app/cli/component-template",
"src/lightning/app/cli/pl-app-template",
"src/lightning/app/cli/react-ui-template",
]
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 = "False" # TODO: set to True when all mirror packages will be reversed
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]]
# the list can be generated with:
# mypy --no-error-summary 2>&1 | tr ':' ' ' | awk '{print $1}' | sort | uniq | sed 's/\.py//g; s|src/||g; s|\/|\.|g' | xargs -I {} echo '"{}",'
module = [
"lightning.app.components.multi_node.fabric",
"lightning.app.components.multi_node.base",
"lightning.app.components.multi_node.pytorch_spawn",
"lightning.app.components.multi_node.trainer",
"lightning.app.api.http_methods",
"lightning.app.api.request_types",
"lightning.app.cli.commands.app_commands",
"lightning.app.cli.commands.connection",
"lightning.app.cli.commands.lightning_cli",
"lightning.app.cli.commands.cmd_install",
"lightning.app.cli.cmd_install",
"lightning.app.components.database.client",
"lightning.app.components.database.server",
"lightning.app.components.database.utilities",
"lightning.app.components.python.popen",
"lightning.app.components.python.tracer",
"lightning.app.components.serve.gradio_server",
"lightning.app.components.serve.serve",
"lightning.app.components.serve.streamlit",
"lightning.app.components.serve.types.image",
"lightning.app.components.serve.types.type",
"lightning.app.components.serve.python_server",
"lightning.app.components.serve.auto_scaler",
"lightning.app.components.training",
"lightning.app.core.api",
"lightning.app.core.app",
"lightning.app.core.flow",
"lightning.app.core.queues",
"lightning.app.core.work",
"lightning.app.frontend.panel.app_state_comm",
"lightning.app.frontend.panel.app_state_watcher",
"lightning.app.frontend.panel.panel_frontend",
"lightning.app.frontend.panel.panel_serve_render_fn",
"lightning.app.frontend.stream_lit",
"lightning.app.frontend.streamlit_base",
"lightning.app.frontend.utils",
"lightning.app.frontend.web",
"lightning.app.perf.pdb",
"lightning.app.runners.backends.__init__",
"lightning.app.runners.backends.backend",
"lightning.app.runners.backends.cloud",
"lightning.app.runners.backends.docker",
"lightning.app.runners.backends.mp_process",
"lightning.app.runners.cloud",
"lightning.app.runners.multiprocess",
"lightning.app.runners.runtime",
"lightning.app.source_code.copytree",
"lightning.app.source_code.hashing",
"lightning.app.source_code.local",
"lightning.app.source_code.tar",
"lightning.app.source_code.uploader",
"lightning.app.storage.copier",
"lightning.app.storage.drive",
"lightning.app.storage.orchestrator",
"lightning.app.storage.path",
"lightning.app.storage.payload",
"lightning.app.structures.dict",
"lightning.app.structures.list",
"lightning.app.testing.helpers",
"lightning.app.testing.testing",
"lightning.app.utilities.app_helpers",
"lightning.app.utilities.app_logs",
"lightning.app.utilities.cli_helpers",
"lightning.app.utilities.cloud",
"lightning.app.utilities.cluster_logs",
"lightning.app.utilities.commands.base",
"lightning.app.utilities.component",
"lightning.app.utilities.enum",
"lightning.app.utilities.exceptions",
"lightning.app.utilities.git",
"lightning.app.utilities.imports",
"lightning.app.utilities.introspection",
"lightning.app.utilities.layout",
"lightning.app.utilities.load_app",
"lightning.app.utilities.log_helpers",
"lightning.app.utilities.login",
"lightning.app.utilities.name_generator",
"lightning.app.utilities.network",
"lightning.app.utilities.openapi",
"lightning.app.utilities.packaging.cloud_compute",
"lightning.app.utilities.packaging.docker",
"lightning.app.utilities.packaging.lightning_utils",
"lightning.app.utilities.port",
"lightning.app.utilities.proxies",
"lightning.app.utilities.scheduler",
"lightning.app.utilities.state",
"lightning.app.utilities.tracer",
"lightning.app.utilities.tree",
"lightning.store.save",
"lightning.store.utils",
"lightning.store.authentication",
"lightning.store.cloud_api",
]
ignore_errors = "True"
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"warnings",
"pass",
"rank_zero_warn",
"raise NotImplementedError",
]
[tool.pytest.ini_options]
norecursedirs = [
".git",
".github",
"dist",
"build",
"docs",
]
addopts = [
"--strict-markers",
"--doctest-modules",
"--color=yes",
"--disable-pytest-warnings",
"--ignore=legacy/checkpoints",
]
markers = [
"cloud:Run the cloud tests for example",
]
filterwarnings = [
"error::FutureWarning",
]
xfail_strict = true
junit_duration_report = "call"