-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
199 lines (178 loc) · 6.24 KB
/
Copy pathpyproject.toml
File metadata and controls
199 lines (178 loc) · 6.24 KB
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
[build-system]
requires = ["setuptools", "build"]
build-backend = "setuptools.build_meta"
[project]
name = "lightning_sdk"
authors = [
{name = "Lightning-AI", email = "justus@lightning.ai"},
]
description = "SDK to develop using Lightning AI Studios"
license = "Apache-2.0"
readme = "README.md"
requires-python = ">=3.11"
keywords = ["deep learning", "machine learning", "pytorch", "AI"]
classifiers = [
"Programming Language :: Python :: 3",
]
dependencies = [ # alphabetically sorted
"backoff", # for api retries
"click", # for CLI
"rich-click", # for rich CLI help formatting
"docker", # for lit-container-registry
"fastapi", # for lightning-cloud
"packaging", # for version checks
"pyyaml", # for config handling
"requests", # for downloading files via urls
"rich", # for nice printing
"simple-term-menu", # for CLI
"six", # for lightning_cloud
"tqdm", # for progressbars
"urllib3<=2.5.0", # for downloading files via urls
"uvicorn", # for login
"websocket-client>=1.6", # for sandbox PTY sessions
]
dynamic = ["version"]
[project.urls]
Homepage = "https://lightning.ai"
Documentation = "https://lightning.ai/docs/overview/sdk-reference"
Repository = "https://github.com/Lightning-AI/sdk"
Source = "https://github.com/Lightning-AI/sdk"
Issues = "https://github.com/Lightning-AI/sdk/issues"
Changelog = "https://github.com/Lightning-AI/sdk/releases"
[project.optional-dependencies]
serve = ["litserve>=0.2.5"]
[dependency-groups]
docs = [
"sphinx>=8.0,<9.0",
"sphinx-click>=6.2,<7.0",
"myst-parser>=5.0.0",
"docutils>=0.20",
"sphinx-autodoc-typehints>=1.16",
"sphinx-paramlinks>=0.5.1,<=0.6.0",
"sphinx-togglebutton>=0.3,<=0.3.2",
"sphinx-copybutton>=0.5,<=0.5.2",
"jinja2<3.2.0",
"pydata-sphinx-theme>=0.15",
]
[project.scripts]
lightning = "lightning_sdk.cli.entrypoint:main_cli"
# same as lightning, enables use with uvx lightning_sdk@latest
lightning-sdk = "lightning_sdk.cli.entrypoint:main_cli"
sandbox = "lightning_sdk.cli.groups:sandbox"
[tool.setuptools.dynamic]
version = {attr = "lightning_sdk.__version__.__version__"}
[tool.setuptools.packages.find]
where = ["."]
exclude = ["tests*", "examples*", "demo*", "docs*"]
[tool.setuptools.package-data]
"lightning_sdk.llm" = ["*.json"]
[tool.setuptools]
include-package-data = true
[tool.black]
# https://github.com/psf/black
line-length = 120
exclude = "(.eggs|.git|.hg|.mypy_cache|.venv|_build|buck-out|build|dist|lightning_sdk/lightning_cloud)"
[tool.docformatter]
recursive = true
wrap-summaries = 119
wrap-descriptions = 120
blank = true
[tool.ruff]
line-length = 120
target-version = "py38"
# Enable Pyflakes `E` and `F` codes by default.
select = [
"E",
"W", # see: https://pypi.org/project/pycodestyle
"F", # see: https://pypi.org/project/pyflakes
"I", #see: https://pypi.org/project/isort/
"D", # see: https://pypi.org/project/pydocstyle
"N", # see: https://pypi.org/project/pep8-naming
"UP", # see: pyupgrade
]
extend-select = [
"A", # see: https://pypi.org/project/flake8-builtins
"B", # see: https://pypi.org/project/flake8-bugbear
"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
"YTT", # see: https://pypi.org/project/flake8-2020
"ANN", # see: https://pypi.org/project/flake8-annotations
"TID", # see: https://pypi.org/project/flake8-tidy-imports/
"T10", # see: https://pypi.org/project/flake8-debugger
"Q", # see: https://pypi.org/project/flake8-quotes
"RUF", # Ruff-specific rules
"ISC", # see: https://pypi.org/project/flake8-implicit-str-concat
"PIE", # see: https://pypi.org/project/flake8-pie
"PLE", # see: https://pypi.org/project/pylint/
"PYI", # see: https://pypi.org/project/flake8-pyi/
]
ignore = [
"D101", # Missing docstring in public function
"D102", # Missing docstring in public function
"D103", # Missing docstring in public function
"A003", # Class attribute shadowing python builtin -> false positive
"E731", # Do not assign a lambda expression, use a def
"D100", # todo: Missing docstring in public module
"D104", # todo: Missing docstring in public package
"D107", # Missing docstring in `__init__`
"D417", # Missing argument in docstring. Ignored since we don't necesarily want to document deprecated args
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod
"S301", # todo: `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue # todo
"S310", # todo: Audit URL open for permitted schemes. Allowing use of `file:` or custom schemes is often unexpected. # todo
"B905", # todo: `zip()` without an explicit `strict=` parameter
"B028", # no explicit stacklevel keyword argument found
"RET506", # Unnecessary elif after raise -> sometimes false positives
]
# Exclude a variety of commonly ignored directories.
exclude = [
".eggs",
".git",
".mypy_cache",
".ruff_cache",
"__pypackages__",
"_build",
"build",
"dist",
"docs",
"examples",
"lightning_sdk/llm/public_assistants.py",
]
ignore-init-module-imports = true
unfixable = ["F401"]
[tool.ruff.per-file-ignores]
"setup.py" = ["ANN202", "ANN401"]
"lightning_sdk/**" = ["ANN401"]
"tests/**" = [
"ANN",
"D",
"A001", # Variable `id` is shadowing a Python builtin
"A002", # FixMe: Argument `id` is shadowing a Python builtin
"PT019", # ToDo: Fixture `_` without value is injected as parameter, use `@pytest.mark.usefixtures` instead
]
"tests/cli/test_help.py" = [
"E501", # Line too long (122 > 120 characters)
]
"lightning_sdk/cli/groups.py" = ["D301"]
[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.coverage.run]
source = ["lightning_sdk"]
omit = [
"lightning_sdk/lightning_cloud/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"pass",
"typing.overload",
]