Files
2026-07-13 13:22:34 +08:00

576 lines
18 KiB
TOML

# 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<=82.0.1"]
build-backend = "setuptools.build_meta"
[project]
name = "mlflow"
version = "3.14.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",
"aiohttp<4,>=3.7.0",
"alembic<2,!=1.10.0",
"cachetools<8,>=5.0.0",
"click<9,>=7.0",
"cloudpickle<4",
"cryptography<49,>=43.0.0",
"databricks-sdk<1,>=0.20.0",
"docker<8,>=4.0.0",
"fastapi<1",
"gitpython<4,>=3.1.9",
"graphene<4",
"gunicorn<27; platform_system != 'Windows'",
"huey<4,>=2.5.4",
"importlib_metadata<10,>=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<8,>=3.12.0",
"pyarrow<25,>=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",
"starlette<2",
"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",
]
gateway = [
"boto3<2,>=1.28.56",
"fastapi<1",
"slowapi<1,>=0.1.9",
"tiktoken<1",
"uvicorn[standard]<1",
"watchfiles<2",
]
genai = [
"boto3<2,>=1.28.56",
"fastapi<1",
"slowapi<1,>=0.1.9",
"tiktoken<1",
"uvicorn[standard]<1",
"watchfiles<2",
]
mcp = ["fastmcp<4,>=2.7.0", "click!=8.3.0"]
azure = ["azure-storage-blob>=12", "azure-identity>=1.6.1"]
sqlserver = ["mlflow-dbstore"]
aliyun-oss = ["aliyunstoreplugin"]
jfrog = ["mlflow-jfrog-plugin"]
kubernetes = ["kubernetes"]
langchain = ["langchain>=0.3.26,<=1.3.4"]
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",
"server/uvicorn_log_config.yaml",
"models/notebook_resources/**/*",
"ai_commands/**/*.md",
"assistant/skills/**/*",
"agent/setup/templates/**/*.md",
"models/container/**/*",
"server/js/build/**/*",
"utils/model_catalog/*.json",
]
[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.17",
"pre-commit==4.0.1",
"toml==0.10.2",
"types-toml",
"mypy==1.17.1",
"ty==0.0.24",
"pydantic>=2.0",
"clint",
"flavors",
"pypi",
"pyyaml>=6.0.2",
"types-PyYAML",
"packaging>=25.0",
"aiohttp",
"pytest",
"requests",
"check-jsonschema==0.37.2",
]
pytest = [
"pytest==9.0.2",
"pytest-asyncio",
"pytest-benchmark",
"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",
"Flask-WTF<2",
"polars>=1",
"openai",
"haystack-ai",
"deepeval",
"ragas",
"instructor",
"langchain-community>=0.3.0",
]
[tool.uv]
exclude-newer = "P7D"
exclude-newer-package = { torch = false, torchvision = false }
required-version = ">=0.11.14"
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",
# setuptools 82.0.0 removed pkg_resources, breaking packages that depend on it (e.g., sphinx)
"setuptools<82",
]
# 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",
"dev/flavors",
"dev/pypi",
"tests/resources/mlflow-test-plugin",
".claude/skills",
]
[tool.uv.sources]
clint = { workspace = true }
flavors = { workspace = true }
pypi = { 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.17"
force-exclude = true
extend-include = ["*.ipynb"]
extension = { mdx = "markdown" }
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]
preview = true
docstring-code-format = true
[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"]
"dev/benchmarks/*" = ["T20"]
"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",
"examples/open_webui/mlflow_filter_pipeline.py",
]
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-import",
"log-model-artifact-path",
"unknown-mlflow-function",
"unknown-mlflow-arguments",
"multi-assign",
"get-artifact-uri",
]
[tool.clint.per-file-ignores]
"^(?!mlflow/).*$" = ["forbidden-set-active-model-usage"]
"^(?!mlflow/|tests/).*$" = ["unnamed-thread", "unnamed-thread-pool"]
# Multi-assign has better readability in this example.
"docs/docs/classic-ml/getting-started/deep-learning.mdx" = ["multi-assign"]
[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]
aimd = "aimd" # additive increase multiplicative decrease
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 = [
# Allowlist: only check these extensions
"*",
"!*/",
"!*.py",
"!*.md",
"!*.mdx",
# Ignore proto files (re-excluded because they match *.py above)
"mlflow/protos/**/*",
# Vendored files
"mlflow/utils/gorilla.py",
# Submodule (typos should be fixed upstream)
"mlflow/assistant/skills/**/*",
]
[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