forked from mlflow/mlflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
565 lines (530 loc) · 17.2 KB
/
pyproject.toml
File metadata and controls
565 lines (530 loc) · 17.2 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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
# Auto-generated by dev/pyproject.py. Do not edit manually.
# This file defines the package metadata of `mlflow` **during development**. To install `mlflow`
# from the source code, `mlflow-skinny` and `mlflow-tracing` are NOT included in the requirements.
# This file will be replaced by `pyproject.release.toml` when releasing a new version.
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "mlflow"
version = "3.9.1.dev0"
description = "MLflow is an open source platform for the complete machine learning lifecycle"
readme = "README.md"
keywords = ["mlflow", "ai", "databricks"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Science/Research",
"Intended Audience :: Information Technology",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
]
requires-python = ">=3.10"
dependencies = [
"Flask-CORS<7",
"Flask<4",
"alembic<2,!=1.10.0",
"cachetools<8,>=5.0.0",
"click<9,>=7.0",
"cloudpickle<4",
"cryptography<47,>=43.0.0",
"databricks-sdk<1,>=0.20.0",
"docker<8,>=4.0.0",
"fastapi<1",
"gitpython<4,>=3.1.9",
"graphene<4",
"gunicorn<26; platform_system != 'Windows'",
"huey<3,>=2.5.4",
"importlib_metadata<9,>=3.7.0,!=4.7.0",
"matplotlib<4",
"numpy<3",
"opentelemetry-api<3,>=1.9.0",
"opentelemetry-proto<3,>=1.9.0",
"opentelemetry-sdk<3,>=1.9.0",
"packaging<27",
"pandas<3",
"protobuf<7,>=3.12.0",
"pyarrow<24,>=4.0.0",
"pydantic<3,>=2.0.0",
"python-dotenv<2,>=0.19.0",
"pyyaml<7,>=5.1",
"requests<3,>=2.17.3",
"scikit-learn<2",
"scipy<2",
"skops<1",
"sqlalchemy<3,>=1.4.0",
"sqlparse<1,>=0.4.0",
"typing-extensions<5,>=4.0.0",
"uvicorn<1",
"waitress<4; platform_system == 'Windows'",
]
[[project.maintainers]]
name = "Databricks"
email = "mlflow-oss-maintainers@googlegroups.com"
[project.license]
file = "LICENSE.txt"
[project.optional-dependencies]
extras = [
"pyarrow",
"requests-auth-aws-sigv4",
"boto3",
"botocore",
"google-cloud-storage>=1.30.0",
"azureml-core>=1.2.0",
"pysftp",
"kubernetes",
"prometheus-flask-exporter",
]
db = ["PyMySQL", "psycopg2-binary", "pymssql"]
databricks = [
"azure-storage-file-datalake>12",
"google-cloud-storage>=1.30.0",
"boto3>1",
"botocore",
"databricks-agents>=1.2.0,<2.0",
]
mlserver = [
"mlserver>=1.2.0,!=1.3.1,<2.0.0",
"mlserver-mlflow>=1.2.0,!=1.3.1,<2.0.0",
]
gateway = [
"aiohttp<4",
"boto3<2,>=1.28.56",
"fastapi<1",
"slowapi<1,>=0.1.9",
"tiktoken<1",
"uvicorn[standard]<1",
"watchfiles<2",
]
genai = [
"aiohttp<4",
"boto3<2,>=1.28.56",
"fastapi<1",
"gepa<1,>=0.0.26",
"litellm<2,>=1.0.0",
"slowapi<1,>=0.1.9",
"tiktoken<1",
"uvicorn[standard]<1",
"watchfiles<2",
]
mcp = ["fastmcp<3,>=2.0.0", "click!=8.3.0"]
sqlserver = ["mlflow-dbstore"]
aliyun-oss = ["aliyunstoreplugin"]
jfrog = ["mlflow-jfrog-plugin"]
langchain = ["langchain>=0.3.15,<=1.2.3"]
auth = ["Flask-WTF<2"]
[project.urls]
homepage = "https://mlflow.org"
issues = "https://github.com/mlflow/mlflow/issues"
documentation = "https://mlflow.org/docs/latest"
repository = "https://github.com/mlflow/mlflow"
[project.scripts]
mlflow = "mlflow.cli:cli"
[project.entry-points."mlflow.app"]
basic-auth = "mlflow.server.auth:create_app"
[project.entry-points."mlflow.app.client"]
basic-auth = "mlflow.server.auth.client:AuthServiceClient"
[project.entry-points."mlflow.deployments"]
databricks = "mlflow.deployments.databricks"
http = "mlflow.deployments.mlflow"
https = "mlflow.deployments.mlflow"
openai = "mlflow.deployments.openai"
[tool.setuptools.package-data]
mlflow = [
"store/db_migrations/alembic.ini",
"temporary_db_migrations_for_pre_1_users/alembic.ini",
"pyspark/ml/log_model_allowlist.txt",
"server/auth/basic_auth.ini",
"server/auth/db/migrations/alembic.ini",
"models/notebook_resources/**/*",
"ai_commands/**/*.md",
"assistant/skills/**/*",
"models/container/**/*",
"server/js/build/**/*",
]
[tool.setuptools.packages.find]
where = ["."]
include = ["mlflow", "mlflow.*"]
exclude = ["tests", "tests.*"]
namespaces = false
# Package metadata: can't be updated manually, use dev/pyproject.py
# -----------------------------------------------------------------
# Dev tool settings: can be updated manually
[dependency-groups]
dev = [
{ include-group = "lint" },
{ include-group = "test" },
{ include-group = "build" },
"mlflow-test-plugin",
"skills",
]
lint = [
"ruff==0.15.0",
"black==23.7.0",
"blacken-docs==1.18.0",
"pre-commit==4.0.1",
"toml==0.10.2",
"types-toml",
"mypy==1.17.1",
"pydantic>=2.0",
"clint",
"pyyaml>=6.0.2",
"types-PyYAML",
"packaging>=25.0",
"aiohttp",
"tiktoken",
"claude-agent-sdk",
"pytest",
"types-requests",
]
pytest = [
"pytest==9.0.2",
"pytest-asyncio",
"pytest-repeat",
"pytest-cov",
"pytest-timeout",
]
test = [
{ include-group = "pytest" },
"psutil",
"pyspark",
"opentelemetry-exporter-otlp-proto-grpc",
"opentelemetry-exporter-otlp-proto-http",
]
build = ["pip", "setuptools", "wheel", "build"]
docs = [
"sphinx==4.2.0",
"sphinx-autobuild",
"sphinx-click",
"sphinx-tabs==3.2.0",
"sphinx-reredirects==0.1.3",
"sphinxcontrib-applehelp<1.0.8",
"sphinxcontrib-devhelp<1.0.6",
"sphinxcontrib-htmlhelp<2.0.4",
"sphinxcontrib-serializinghtml<1.1.10",
"sphinxcontrib-qthelp<1.0.7",
"nbconvert",
"nbformat",
"tensorflow",
"keras",
"pyspark",
"datasets",
"plotly",
"torch>=1.11.0",
"torchvision>=0.12.0,!=0.24.0",
"lightning>=1.8.1",
"Flask-WTF<2",
"polars>=1",
"openai",
"haystack-ai",
"deepeval",
"ragas",
"instructor",
"litellm",
"langchain-community>=0.3.0",
]
[tool.uv]
required-version = ">=0.9.8"
constraint-dependencies = [
# xgboost 3.1.0 changed base_score format to vector for multi-output models, breaking shap compatibility
# https://xgboost.readthedocs.io/en/latest/changes/v3.1.0.html#multi-target-class-intercept
"xgboost<3.1.0",
# pyspark 4.1.0 causes issues with documentation build
"pyspark<4.1.0",
# TODO: Remove this once transformers 5.x is supported
"transformers<5",
]
# Prevent third-party libraries from installing uv to avoid conflicts with uv installed
# by the standalone installer
exclude-dependencies = ["uv"]
[tool.uv.pip]
torch-backend = "cpu"
[tool.uv.workspace]
members = ["dev/clint", "tests/resources/mlflow-test-plugin", ".claude/skills"]
[tool.uv.sources]
clint = { workspace = true }
mlflow-test-plugin = { workspace = true }
skills = { workspace = true }
torch = { index = "pytorch-cpu" }
torchvision = { index = "pytorch-cpu" }
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.ruff]
line-length = 100
target-version = "py310"
required-version = "0.15.0"
force-exclude = true
extend-include = ["*.ipynb"]
extend-exclude = [
"examples/llama_index/workflow",
"mlflow/assistant/skills",
"mlflow/protos",
"mlflow/ml_package_versions.py",
"mlflow/server/graphql/autogenerated_graphql_schema.py",
"mlflow/server/js",
"tests/protos",
]
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = 88
[tool.ruff.lint]
preview = true
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
select = [
"B006", # multiple-argument-default
"B012", # jump-statement-in-finally
"B015", # useless-comparison
"D209", # new-line-after-last-paragraph
"D411", # no-blank-line-before-section
"DTZ003", # call-datetime-utcnow
"E", # error
"F", # Pyflakes
"FURB110", # if-exp-instead-of-or-operator
"FURB129", # readlines-in-for
"FURB142", # for-loop-set-mutations
"FURB148", # unnecessary-enumerate
"FURB167", # regex-flag-alias
"FURB188", # slice-to-remove-prefix-or-suffix
"FURB192", # sorted-min-max
"C4", # flake8-comprehensions
"I", # isort
"ISC001", # single-line-implicit-string-concatenation
"N804", # invalid-first-argument-name-for-class-method
"PERF401", # manual-list-comprehension
"PIE790", # unnecessary-placeholder
"PLR0402", # manual-from-import
"PLR1714", # repeated-equality-comparison
"PLE1205", # logging-too-many-args
"PLW0602", # global-variable-not-assigned
"PLW1508", # invalid-envvar-default
"PT001", # pytest-fixture-incorrect-parentheses-style
"PT002", # pytest-fixture-positional-args
"PT003", # pytest-extraneous-scope-function
"PT006", # pytest-parameterize-names-wrong-type
"PT007", # pytest-parameterize-values-wrong-type
"PT009", # pytest-unittest-assertion
"PT010", # pytest-raises-without-exception
"PT011", # pytest-raises-too-broad
"PT012", # pytest-raises-with-multiple-statements
"PT013", # pytest-incorrect-pytest-import
"PT014", # pytest-duplicate-parametrize-test-cases
"PT017", # pytest-assert-in-except
"PT018", # pytest-composite-assertion
"PT022", # pytest-useless-yield-fixture
"PT023", # pytest-incorrect-mark-parentheses-style
"PT026", # pytest-use-fixtures-without-parameters
"PT027", # pytest-unittest-raises-assertion
"PT030", # pytest-warns-too-broad
"PT031", # pytest-warns-with-multiple-statements
"PYI024", # collections-named-tuple
"RET504", # unnecessary-assign
"RUF002", # ambiguous-unicode-character-docstring
"RUF003", # ambiguous-unicode-character-comment
"RUF010", # explicit-f-string-type-conversion
"RUF013", # implicit-optional
"RUF039", # unraw-re-pattern
"RUF051", # if-key-in-dict-del
"RUF068", # duplicate-entry-in-dunder-all
"RUF100", # unused-noqa
"S102", # exec-builtin
"S307", # suspicious-eval-usage
"S324", # hashlib-insecure-hash-function
"S506", # unsafe-yaml-load
"SIM101", # duplicate-isinstance-call
"SIM108", # if-else-block-instead-of-if-exp
"SIM114", # if-with-same-arms
"SIM115", # open-file-with-context-handler
"SIM210", # if-expr-with-true-false
"SIM910", # dict-get-with-none-default
"T20", # flake8-print
"TID251", # banned-api
"TID252", # relative-import
"TRY203", # useless-try-except
"UP004", # useless-object-inheritance
"UP006", # non-pep585-annotation
"UP007", # non-pep604-annotation-union
"UP008", # super-call-with-parameters
"UP011", # lru-cache-without-parameters
"UP012", # unnecessary-encode-utf8
"UP015", # redundant-open-modes
"UP030", # format-literals
"UP031", # printf-string-format
"UP034", # extraneous-parenthesis
"UP045", # non-pep604-annotation-optional
"W", # warning
]
ignore = [
"E265", # no-space-after-block-comment
"E266", # multiple-leading-hashes-for-block-comment
"E402", # module-import-not-at-top-of-file
"E721", # type-comparison
"E741", # ambiguous-variable-name
"F811", # redefined-while-unused
]
[tool.ruff.lint.per-file-ignores]
"dev/*" = ["T201", "PT018"]
"examples/*" = ["T20", "RET504", "E501"]
"docs/*" = ["T20", "RET504", "E501"]
"mlflow/*" = ["PT018"]
[tool.ruff.lint.flake8-pytest-style]
mark-parentheses = false
fixture-parentheses = false
raises-require-match-for = ["*"]
warns-require-match-for = ["*"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.isort]
forced-separate = ["tests"]
# https://docs.astral.sh/ruff/faq/#how-does-ruff-determine-which-of-my-imports-are-first-party-third-party-etc
# The `docker` package is marked as third-party because a `docker` directory exists in the repository root,
# which would otherwise cause ruff to incorrectly classify it as first-party.
known-third-party = ["docker"]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"pkg_resources".msg = "Do not use pkg_resources. Use importlib.resources or importlib.metadata instead."
"entrypoints".msg = "Do not use entrypoints. Use importlib.metadata.entry_points instead."
"pip".msg = "Importing pip can cause undesired side effects such as https://github.com/scikit-learn/scikit-learn/issues/26992. Consider using `subprocess.run([sys.executable, '-m', 'pip', ...])` instead."
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.clint]
exclude = [
"mlflow/assistant/skills",
"mlflow/protos",
"mlflow/ml_package_versions.py",
"mlflow/models/notebook_resources/eval_with_synthetic_example.py",
"mlflow/server/js",
"mlflow/store/db_migrations",
"mlflow/genai/__init__.py",
"mlflow/genai/datasets/__init__.py",
"mlflow/genai/labeling/__init__.py",
"mlflow/genai/label_schemas/__init__.py",
"tests/protos",
"docs/docs/classic-ml/mlflow-3/index.mdx",
]
typing-extensions-allowlist = [
# Docs: https://typing-extensions.readthedocs.io/en/latest/
"typing_extensions.Self", # Added in 4.0.0
"typing_extensions.NotRequired", # Added in 4.0.0
]
# Rules that are only enabled for code examples.
example-rules = [
"lazy-builtin-import",
"log-model-artifact-path",
"unknown-mlflow-function",
"unknown-mlflow-arguments",
"multi-assign",
"get-artifact-uri",
]
[tool.clint.per-file-ignores]
# Rules that should only be enabled for files in the root mlflow directory
"^(?!mlflow/).*$" = [
"forbidden-set-active-model-usage",
"unnamed-thread",
"unnamed-thread-pool",
]
# Multi-assign has better readability in this example.
"docs/docs/classic-ml/getting-started/deep-learning.mdx" = ["multi-assign"]
# New experimental TruLens agent scorers - not yet in clint's static allowlist.
"mlflow/genai/scorers/trulens/scorers/agent_trace.py" = [
"unknown-mlflow-function",
]
[tool.clint.forbidden-top-level-imports]
"mlflow/gateway/providers/*" = ["fastapi", "starlette", "aiohttp"]
# Databricks SDK/Agents should not be imported at the top level
"mlflow/*" = ["databricks"]
# typos
[tool.typos.default.extend-words]
als = "als" # alternating least squares
mape = "mape" # mean absolute percentage error
fpr = "fpr" # false positive rate
gam = "gam" # generalized additive models
ser = "ser" # serialization
yhat = "yhat" # ŷ
iternal = "internal" # typo of "internal"
instumentation = "instrumentation" # typo of "instrumentation"
selectin = "selectin" # SQLAlchemy lazy loading strategy
tpe = "tpe" # Tree-structured Parzen Estimator (hyperopt/optuna)
TPE = "TPE" # Tree-structured Parzen Estimator (hyperopt/optuna)
indx = "indx" # intentional shorthand for index
Tru = "Tru" # TruLens library name prefix
# https://github.com/crate-ci/typos/blob/master/docs/reference.md
[tool.typos.files]
extend-exclude = [
# Ignore proto files
"mlflow/protos/**/*",
# Vendored files
"mlflow/utils/gorilla.py",
]
[tool.typos.default]
extend-ignore-re = [
# Line ignore with trailing `# spellchecker: disable-line`
"(?Rm)^.*#\\s*spellchecker: disable-line$",
# Line block with `# spellchecker: <on|off>`
"(?s)(#|//)\\s*spellchecker: off.*?\\n\\s*(#|//)\\s*spellchecker: on",
# numpy.arange
"(?i)(numpy|np)\\.arange",
# nd array
"(?i)nd( |_|\\.)?array",
"aNothEr",
# German / French words/sentences used for testing
"MLflow ist",
"Ich habe eine schöne Haufe von Kokos",
"Ich bin das Modell eines modernen General",
"Apple Inc. ist ein",
"Apple Inc. est une entreprise technologique",
# pytorch-lightning
"lightning",
# `typos` flags 'lok' as a typo of 'look'
"(?i)daniel lok",
# GitHub user mentions
"@[a-z0-9-]+",
"PNGs",
# Azure Container Instances
"\\(ACI\\)",
# Azure Kubernetes Service
"\\(AKS\\)",
"AKS",
# Song lyrics - "Don't Stop Believin'" by Journey
"livin'",
]
[tool.pytest]
addopts = [
"-p",
"no:legacypath",
"--strict-markers",
"--color=yes",
"--durations=10",
"--showlocals",
"--no-header",
"-v",
]
filterwarnings = [
# Prevent deprecated numpy type aliases from being used
"error:^`np\\.[a-z]+` is a deprecated alias for.+:DeprecationWarning:mlflow",
"error:^`np\\.[a-z]+` is a deprecated alias for.+:DeprecationWarning:tests",
"error::pytest.PytestCollectionWarning",
"error:.*type should be str.*converted to str implicitly:pytest.PytestWarning",
# Prevent deprecated threading.Thread.getName() from being used
"error:getName\\(\\) is deprecated, get the name attribute instead:DeprecationWarning",
# Prevent deprecated non-integer arguments to randrange() from being used
"error:non-integer arguments to randrange\\(\\) have been deprecated:DeprecationWarning",
# Prevent usage of deprecated Pydantic v2.0 features
"error::pydantic.PydanticDeprecatedSince20:mlflow",
"error::pydantic.PydanticDeprecatedSince20:tests",
# Silence filesystem backend deprecation warnings (https://github.com/mlflow/mlflow/issues/18534)
"ignore:The filesystem (tracking|model registry) backend.*is deprecated:FutureWarning",
# Prevent deprecated generator.throw(type, value, tb) signature from being used (Python 3.12+)
"error:the \\(type, exc, tb\\) signature of throw\\(\\) is deprecated:DeprecationWarning",
]
# Use string for pytest-timeout compatibility (https://github.com/pytest-dev/pytest-timeout/issues/194)
timeout = "1200"
# Currently, type checking is only enabled for `dev/clint` and `.claude/skills`.
[tool.mypy]
python_version = "3.10"
strict = true
exclude_gitignore = true