Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
413 lines (371 loc) · 13 KB
/
Copy pathpyproject.toml
File metadata and controls
413 lines (371 loc) · 13 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
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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
[build-system]
requires = ["hatchling", "typing_extensions"]
build-backend = "hatchling.build"
[project]
name = "wandb"
dynamic = ["version"]
description = "A CLI and library for interacting with the Weights & Biases API."
authors = [{ name = "Weights & Biases", email = "support@wandb.com" }]
readme = "package_readme.md"
license = { file = "LICENSE" }
requires-python = ">=3.10"
dependencies = [
"Click>=8.2.0",
# Pin exact cwevals version during preview as API is subject to change.
"cwevals==0.0.1b1",
"requests>=2.0.0,<3",
"protobuf>=5,!=5.28.0,!=5.29.0,<8",
"PyYAML",
"platformdirs",
"typing_extensions>=4.8,<5",
"pydantic>=2.6,<3",
"packaging",
"opentelemetry-api>=1.43.0",
"opentelemetry-sdk>=1.43.0",
"opentelemetry-exporter-otlp-proto-http>=1.43.0",
"xxhash>=3.0.0",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Go",
"Programming Language :: Rust",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Logging",
"Topic :: System :: Monitoring",
]
[project.scripts]
wandb = "wandb.cli.cli:cli"
wb = "wandb.cli.cli:cli"
[project.urls]
"Source" = "https://github.com/wandb/wandb"
"Bug Reports" = "https://github.com/wandb/wandb/issues"
"Documentation" = "https://docs.wandb.ai"
[project.optional-dependencies]
kubeflow = ["kubernetes", "minio", "google-cloud-storage", "sh"]
gcp = ["google-cloud-storage"]
aws = [
"boto3",
"botocore>=1.5.76",
# https://github.com/boto/botocore/pull/1107
# https://github.com/boto/botocore/pull/1230
]
azure = ["azure-identity", "azure-storage-blob"]
media = [
"numpy",
"moviepy>=1.0.0",
# imageio is a dependency of moviepy but incase that changes we also pin it here
# imageio versions before 2.28.1 do not work properly when encoding videos.
"imageio>=2.28.1",
"pillow",
"bokeh",
"soundfile",
"plotly>=5.18.0",
"rdkit",
]
sweeps = ["sweeps>=0.2.0"]
optuna = ["optuna>=4.0.0"]
ax = ["ax-platform>=1.3.1; python_version >= '3.11'"]
launch = [
"wandb[aws]",
"awscli",
"azure-identity",
"azure-containerregistry",
"azure-storage-blob",
"chardet",
"google-auth",
"google-cloud-aiplatform",
"google-cloud-artifact-registry",
"google-cloud-compute",
"google-cloud-storage",
"iso8601",
"jsonschema",
"kubernetes",
"kubernetes_asyncio",
"optuna",
"nbconvert",
"nbformat",
"pydantic",
"typing_extensions",
"tomli",
"PyYAML>=6.0.0",
"tornado>=6.5.0",
]
models = ["cloudpickle"]
workspaces = ["wandb-workspaces"]
# cwsandbox requires Python >=3.11, so this extra is unavailable on 3.10.
sandbox = ["cwsandbox[cli]>=1.0.0; python_version >= '3.11'"]
eval-table = [ # wandb.EvalTable support (private testing only)
"weave>=0.52.41",
]
# wandb.EvalTable wandb.Video support
# TODO: Currently, wandb[media] requires moviepy>=1.0.0, while
# weave[video_support] requires moviepy<=1.0.3. We should reconcile these
# dependencies (and probably make weave support moviepy>=2).
eval-table-video-support = ["weave[video_support]>=0.52.41"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
minversion = "6.0"
console_output_style = "count"
addopts = "-vvv --cov-config=pyproject.toml"
markers = [
"image_output",
"multiclass",
"wandb_args",
"flaky",
"skip_wandb_core(feature): skip tests that fail on wandb-core, gropued by feature",
"wandb_core_only: tests for features only available with wandb-core",
]
timeout = 60
log_format = "%(asctime)s %(levelname)s %(message)s"
log_date_format = "%Y-%m-%d %H:%M:%S"
filterwarnings = ["ignore::DeprecationWarning", "error:ResourceWarning"]
testpaths = "tests"
# The testpaths setting is ignored by VSCode's usage of pytest --collect-only,
# causing it to execute files named test_*.py while trying to do pytest
# discovery.
norecursedirs = [
".*",
"build",
"dist",
]
[tool.coverage.paths]
wandb = ["wandb/", "**/site-packages/wandb/"]
[tool.coverage.run]
concurrency = ["multiprocessing", "thread"]
omit = ["**/wandb/proto/**"]
[tool.coverage.report]
exclude_also = ["if TYPE_CHECKING:", "@abstractmethod"]
omit = ["**/wandb/proto/**"]
ignore_errors = true
[tool.ruff]
extend-exclude = [
"wandb/__init__.py",
"wandb/proto/**",
]
target-version = "py310"
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
select = [
"F", # Pyflakes
"FA", # flake8-future-annotations
"E", # pycodestyle Error
"W", # pycodestyle Warning
"B", # flake8-bugbear
"I", # isort
"N", # pep8-naming
"D", # pydocstyle
"C90", # mccabe
"UP", # pyupgrade
"T20", # flake8-print
"TC004", # flake8-type-checking
"TC005", # flake8-type-checking
"RUF100", # unused-noqa
# flake8-simplify
"SIM101", # duplicate-isinstance-call
"SIM102", # collapsible-if
"SIM103", # needless-bool
"SIM109", # compare-with-tuple
"SIM110", # reimplemented-builtin
"SIM118", # in-dict-keys
"SIM201", # negate-equal-op
"SIM202", # negate-not-equal-op
"SIM208", # double-negation
"SIM211", # if-expr-with-false-true
"SIM401", # if-else-block-instead-of-dict-get
"SIM910", # dict-get-with-none-default
"SIM911", # zip-dict-keys-and-values
# tryceratops
"TRY004", # type-check-without-type-error
"TRY201", # verbose-raise
"TRY203", # useless-try-except
"TRY300", # try-consider-else
"TRY301", # raise-within-try
"TRY400", # error-instead-of-exception
"TRY401", # verbose-log-message
]
ignore = [
"B904",
"E501",
# pydocstyle rules: https://docs.astral.sh/ruff/rules/#pydocstyle-d
"D100", # Allow missing docstrings in modules.
"D101", # Allow missing docstrings in classes.
"D104", # Allow missing docstrings in packages.
"D105", # Allow missing docstrings in magic (dunder) methods, e.g. __str__().
"D106", # Allow missing docstrings in nested classes.
"D107", # Allow missing docstrings in __init__ methods.
]
[tool.ruff.lint.mccabe]
max-complexity = 18
[tool.ruff.lint.isort]
split-on-trailing-comma = false
[tool.ruff.lint.pep8-naming]
classmethod-decorators = [
# Allow Pydantic's `@field_validator` to trigger classmethod treatment.
"pydantic.field_validator",
]
[tool.ruff.lint.pycodestyle]
ignore-overlong-task-comments = true
max-doc-length = 90 # Consider this an 80-character limit with buffer
[tool.ruff.lint.pydocstyle]
convention = "google"
ignore-decorators = [
# Allow undocumented @property descriptors for now.
#
# As of May 2024, many in the public API module(s) currently lack docs,
# or may plausibly have been intended for internal use only. Consider
# removing this exemption in the future, when/if/as appropriate.
"property",
]
[tool.ruff.lint.per-file-ignores]
# Ignore some docstring requirements everywhere except in some public APIs.
# - D101: Require docstrings in public classes
# - D102: Require docstrings in public methods
# - D103: Require docstrings in public functions
# - D417: Require descriptions for all arguments
"!wandb/apis/public/api.py" = [
"D101",
"D102",
"D103",
"D417",
] # "Public API" module
"!wandb/automations/**/*.py" = [
"D101",
"D102",
"D103",
"D417",
] # Automations submodules
# Relax docstring and print() statement requirements in tests.
"tests/**" = ["D", "T20", "W505"]
# Allow internal tools to use print() and relax docstring width constraints.
"tools/**" = ["T20", "W505"]
# Ignore unused imports in all __init__.py files.
# TODO: Unignore this lint and add symbols to __all__ instead.
"**/__init__.py" = ["F401"]
"wandb/__init__.py" = ["I001"]
"wandb/__init__.pyi" = ["W505"]
"wandb/__init__.template.pyi" = ["D415", "N999"]
# TODO: Use f-strings in wandb/apis/public/ for GraphQL statements.
# To preserve GraphQL syntax highlighting, add #graphql at the start of
# the f-strings. Do not auto-fix the lint, as that will break syntax
# highlights and harm readability.
"wandb/apis/public/**" = ["UP032"]
# TODO: Fix these lints and remove the ignores.
"xpu/hatch.py" = ["W505"]
"noxfile.py" = ["W505"]
"wandb/cli/cli.py" = ["C901", "W505"]
"wandb/integration/metaflow/metaflow.py" = ["F811"]
"wandb/old/**" = ["B006", "B020", "D", "F822", "W505"]
"wandb/plot/**" = ["D", "B007", "F401", "N812", "F841", "UP031", "W505"]
"wandb/sdk/internal/file_stream.py" = ["TRY300"]
"wandb/sdk/launch/**" = ["T20", "W505"]
"wandb/sdk/launch/agent/agent.py" = ["TRY300"]
"wandb/sdk/launch/builder/templates/_wandb_bootstrap.py" = ["TRY300"]
"wandb/sdk/launch/environment/aws_environment.py" = ["TRY300"]
"wandb/sdk/launch/environment/gcp_environment.py" = ["TRY300"]
"wandb/sdk/launch/registry/azure_container_registry.py" = ["TRY300"]
"wandb/sdk/launch/runner/abstract.py" = ["TRY300"]
"wandb/sdk/launch/runner/kubernetes_runner.py" = ["TRY300"]
"wandb/sdk/launch/sweeps/scheduler.py" = ["TRY300"]
"wandb/sdk/launch/utils.py" = ["TRY300"]
"wandb/sklearn/**" = ["B010", "B011", "N803", "N806", "UP031"]
"wandb/wandb_controller.py" = ["N806"]
"wandb/wandb_torch.py" = ["C901", "D", "E741", "F841"]
"wandb/agents/**" = ["W505"]
"wandb/analytics/**" = ["W505"]
"wandb/apis/paginator.py" = ["W505"]
"wandb/apis/public/api.py" = ["W505"]
"wandb/apis/public/files.py" = ["W505"]
"wandb/apis/public/jobs.py" = ["W505"]
"wandb/apis/public/reports.py" = ["W505"]
"wandb/apis/public/runs.py" = ["W505"]
"wandb/apis/public/sweeps.py" = ["W505"]
"wandb/apis/public/teams.py" = ["W505"]
"wandb/apis/public/utils.py" = ["W505"]
"wandb/filesync/**" = ["W505"]
"wandb/data_types.py" = ["W505"]
"wandb/env.py" = ["W505"]
"wandb/jupyter.py" = ["W505"]
"wandb/integration/**" = ["W505"]
"wandb/sdk/data_types/**" = ["W505"]
"wandb/sdk/integration_utils/**" = ["W505"]
"wandb/sdk/internal/**" = ["W505"]
"wandb/sdk/interface/**" = ["W505"]
"wandb/sdk/lib/**" = ["W505"]
"wandb/sdk/wandb_*.py" = ["W505"]
"wandb/wandb_*.py" = ["W505"]
"wandb/util.py" = ["W505"]
# Ignore specific naming rules on codegen scripts or plugins.
# Codegen logic relies on Python's `ast` module, in which implementing a custom
# NodeVisitor/NodeTransformer requires method names (e.g. `visit_ClassDef`)
# that violate Python's own PEP8 guidelines.
# See: https://docs.python.org/3/library/ast.html#ast.NodeTransformer
"tools/graphql_codegen/**" = ["N802"]
# Generated code names may not respect PEP8.
"wandb/**/_generated/**/*.py" = ["N8"]
[tool.ty.environment]
python-version = "3.10"
[tool.ty.src]
include = ["wandb"]
exclude = ["wandb/proto", "wandb/integration"]
[tool.ty.rules]
unresolved-attribute = "ignore"
invalid-argument-type = "ignore"
unused-type-ignore-comment = "ignore"
possibly-missing-submodule = "ignore"
unresolved-import = "ignore"
invalid-assignment = "ignore"
invalid-method-override = "ignore"
call-non-callable = "ignore"
not-subscriptable = "ignore"
deprecated = "ignore"
no-matching-overload = "ignore"
invalid-attribute-override = "ignore"
invalid-type-form = "ignore"
invalid-key = "ignore"
call-top-callable = "ignore"
[tool.basedpyright]
pythonVersion = "3.10"
pythonPlatform = "All"
# We use implicit string concatenation quite a lot, so don't yell too loud.
reportImplicitStringConcatenation = "hint"
# Our convention is that the type of a field assigned in __init__() is
# the type of what it's assigned to. Don't duplicate annotations like in
#
# def __init__(self, value: SomeType) -> None:
# self._value: SomeType = value
reportUnannotatedClassAttribute = false
reportIncompatibleUnannotatedOverride = "error"
# While this seems like a good idea, it's very common to ignore return values
# in Python. For instance:
#
# - threading.Event.wait() always returns True if no timeout is passed
# - asyncio.Event.wait() always returns True no matter what
# - call_soon_threadsafe() in asyncio returns a Handle that is rarely useful
# - asyncio.Task.cancel() returns a boolean that's rarely useful
reportUnusedCallResult = false
# Any is frequently unavoidable when forwarding an argument with a generic type
# to a library function that didn't specify the generic type parameters.
reportExplicitAny = "hint"
[tool.cibuildwheel.linux]
# The release workflow relies on this table and the musllinux override below.
# Do not replace it with CIBW_ENVIRONMENT_LINUX: environment variables take
# precedence over pyproject.toml, including over the CGO override.
environment = { PATH = "$PATH:/usr/local/go/bin:/root/.cargo/bin" }
[[tool.cibuildwheel.overrides]]
select = "*-musllinux*"
inherit.environment = "append"
environment = { WANDB_ENABLE_CGO = "true" }