[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "mteb"
version = "1.14.21"
description = "Massive Text Embedding Benchmark"
readme = "README.md"
authors = [
    { name = "MTEB Contributors", email = "niklas@huggingface.co" },
    { email = "nouamane@huggingface.co" },
    { email = "info@nils-reimers.de" },
]
license = { file = "LICENSE" }
keywords = ["deep learning", "text embeddings", "benchmark"]
classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Environment :: Console",
    "Intended Audience :: Developers",
    "Intended Audience :: Information Technology",
    "License :: OSI Approved :: Apache Software License",
    "Operating System :: OS Independent",
    "Programming Language :: Python",
]
requires-python = ">=3.8"
dependencies = [
    "datasets>=2.19.0",
    "numpy>=1.0.0,<2.0.0", # note: https://github.com/huggingface/datasets/issues/6980
    "requests>=2.26.0",
    "scikit_learn>=1.0.2",
    "scipy>=0.0.0",
    "sentence_transformers>=3.0.0",
    "typing-extensions>=4.5.0",
    "torch>1.0.0",
    "tqdm>1.0.0",
    "rich>=0.0.0",
    "pytrec-eval-terrier>=0.5.6",
    "pydantic>=2.0.0",
    "typing_extensions>=0.0.0",
    "eval_type_backport>=0.0.0",
    "polars>=0.20.22",
]


[project.urls]
homepage = "https://github.com/embeddings-benchmark/mteb"
"Huggingface Organization" = "https://huggingface.co/mteb"
"Source Code" = "https://github.com/embeddings-benchmark/mteb"

[project.scripts]
mteb = "mteb.cli:main"

[project.optional-dependencies]
dev = ["ruff==0.6.4", # locked so we don't get PRs which fail only due to a lint update
"pytest", "pytest-xdist", "pytest-coverage"]
codecarbon = ["codecarbon"]
speedtask = ["GPUtil>=1.4.0", "psutil>=5.9.8"]
peft = ["peft>=0.11.0"]


[tool.coverage.report]

omit = ["tests/*", "mteb/tasks/**/*", "scripts"]

# Regexes for lines to exclude from consideration
exclude_also = [
    # Don't complain about missing debug-only code:
    "def __repr__",
    "if self\\.debug",

    # Don't complain if tests don't hit defensive assertion code:
    "raise AssertionError",
    "raise NotImplementedError",

    # Don't complain if non-runnable code isn't run:
    "if 0:",
    "if __name__ == .__main__.:",

    # Don't complain about abstract methods, they aren't run:
    "@(abc\\.)?abstractmethod",
    ]

[tool.setuptools.packages.find]
exclude = ["tests", "results"]

[tool.setuptools.package-data]
"*" = ["*.json"]

[tool.ruff]

target-version = "py38"


[tool.ruff.lint]
select = [
    "F",  # pyflakes rules, 
    "I",  # sorting for imports
    "E",  # formatting for docs
    "D",  # formatting for docs
    "UP", # upgrade to latest syntax if possible
    "FA", # Future annotations
    "C4", # cleaner comprehensions
]


ignore = ["E501",   # line too long 
        "E741",     # ambiguous variable name
        "F403",     # undefined import
        "D100",     # Missing docstring in public module
        "D101",     # Missing docstring in public class
        "D102",     # Missing docstring in public method
        "D103",     # Missing docstring in public function
        "D105",     # Missing docstring in magic method
        "D104",     # Missing docstring in public package
        "D107",     # Missing docstring in __init__
        "D205",     # 1 blank line required between summary line and description
        "D415",     # First line should end with a period
]


[tool.ruff.lint.flake8-implicit-str-concat]
allow-multiline = false

[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.ruff.lint.flake8-annotations]
mypy-init-return = true
suppress-none-returning = true

[tool.semantic_release]
branch = "main"
version_toml = ["pyproject.toml:project.version"]
build_command = "python -m pip install build; python -m build"
tag_format = "{version}"

[tool.semantic_release.commit_parser_options]
major_types = ["breaking"]
minor_types = ["feat"]
patch_types = ["fix", "perf"]
