[build-system]
build-backend = "setuptools.build_meta"
requires = [ "setuptools>=61" ]

[project]
name = "supervision"
version = "0.31.0.dev0"
description = "A set of easy-to-use utils that will come in handy in any Computer Vision project"
readme = "README.md"
keywords = [
  "AI",
  "deep-learning",
  "DL",
  "machine-learning",
  "ML",
  "Roboflow",
  "vision",
]
license = "MIT"
maintainers = [
  { name = "Piotr Skalski", email = "piotr@roboflow.com" },
]
authors = [
  { name = "Roboflow et al.", email = "develop@roboflow.com" },
]
requires-python = ">=3.10"
classifiers = [
  "Development Status :: 5 - Production/Stable",
  "Intended Audience :: Developers",
  "Intended Audience :: Education",
  "Intended Audience :: Science/Research",
  "Operating System :: MacOS",
  "Operating System :: Microsoft :: Windows",
  "Operating System :: POSIX :: Linux",
  "Programming Language :: Python :: 3 :: Only",
  "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",
  "Topic :: Multimedia :: Graphics",
  "Topic :: Multimedia :: Video",
  "Topic :: Scientific/Engineering",
  "Topic :: Scientific/Engineering :: Artificial Intelligence",
  "Topic :: Scientific/Engineering :: Image Recognition",
  "Topic :: Software Development",
  "Typing :: Typed",
]
dependencies = [
  "av>=14.2",
  "defusedxml>=0.7.1",
  "matplotlib>=3.6",
  "numpy>=1.21.2",
  "pillow>=9.4",
  "pydeprecate>=0.9,<0.12",
  "pyyaml>=5.3",
  "requests>=2.26",
  "scipy>=1.10",
  "tqdm>=4.62.3"
]
optional-dependencies.geotiff = [
  "rasterio>=1.3", # 1.3 introduced stable window-read API and CRS.is_projected
]
optional-dependencies.metrics = [
  "pandas>=2",
]
urls.Documentation = "https://supervision.roboflow.com/latest/"
urls.Homepage = "https://github.com/roboflow/supervision"
urls.Repository = "https://github.com/roboflow/supervision"

[dependency-groups]
dev = [
  "docutils!=0.21",
  "ipywidgets>=8.1.1",
  "jupytext>=1.16.1",
  "nbconvert>=7.14.2",
  "notebook>=6.5.3,<8",
  "pre-commit>=3.8",
  "pytest>=7.2.2,<10",
  "pytest-cov>=4,<8",
  "scikit-learn>=1.7",
  "tox>=4.11.4",
  "types-tqdm",
]
docs = [
  "mike>=2",
  "mkdocs-git-committers-plugin-2>=2.4.1; python_version>='3.10' and python_version<'4'",
  "mkdocs-git-revision-date-localized-plugin>=1.2.4",
  "mkdocs-jupyter>=0.24.3",
  "mkdocs-material[imaging]>=9.7",
  "mkdocstrings>=1,<1.1",
  "mkdocstrings-python>=2,<3",
]
build = [
  "build>=1,<1.6",
  "twine>=5.1.1,<8",
  "wheel>=0.40,<0.49",
]

[tool.setuptools]
packages.find.where = [ "src" ]
packages.find.include = [ "supervision*" ]
include-package-data = false
package-data.supervision = [ "py.typed" ]
# exclude = [ "docs*", "tests*", "examples*" ]

[tool.ruff]
target-version = "py310"
line-length = 88
indent-width = 4
# Exclude a variety of commonly ignored directories.
exclude = [
  ".bzr",
  ".direnv",
  ".eggs",
  ".git",
  ".git-rewrite",
  ".hg",
  ".mypy_cache",
  ".nox",
  ".pants.d",
  ".pytype",
  ".ruff_cache",
  ".svn",
  ".tox",
  ".venv",
  "__pypackages__",
  "_build",
  "buck-out",
  "build",
  "dist",
  "docs",
  "node_modules",
  "venv",
  "yarn-error.log",
  "yarn.lock",
]
# Like Black, indent with spaces, rather than tabs.
format.indent-style = "space"
# Like Black, use double quotes for strings.
format.quote-style = "double"
# Like Black, automatically detect the appropriate line ending.
format.line-ending = "auto"
# Like Black, respect magic trailing commas.
format.skip-magic-trailing-comma = false
# Enable linting rules for code style, imports, and best practices.
lint.select = [
  "A",   # flake8-builtins - https://docs.astral.sh/ruff/rules/#flake8-builtins-a
  "E",   # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e
  "F",   # Pyflakes - https://docs.astral.sh/ruff/rules/#pyflakes-f
  "I",   # isort - https://docs.astral.sh/ruff/rules/#isort-i
  "PT",  # pytest - https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
  "Q",   # flake8-quotes - https://docs.astral.sh/ruff/rules/#flake8-quotes-q
  "RUF", # Ruff-specific rules - https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
  "S",   # bandit - https://docs.astral.sh/ruff/rules/#flake8-bandit-s
  "UP",  # pyupgrade - https://docs.astral.sh/ruff/rules/#pyupgrade-up
  "W",   # pycodestyle warnings - https://docs.astral.sh/ruff/rules/#pycodestyle-w
]
lint.ignore = []
lint.per-file-ignores."__init__.py" = [ "E402", "F401" ]
lint.per-file-ignores."notebooks/**" = [
  "PT018", # Assertion should be broken down into multiple parts
  "S101",  # Use of `assert` detected
]
lint.per-file-ignores."src/**" = [
  "S101", # TODO: Replace asserts with proper error handling
]
lint.per-file-ignores."tests/**" = [
  "S101", # Use of `assert` detected
  "S603", # `subprocess` call: subprocess with hardcoded args in test utilities is safe
]
lint.unfixable = []
# Allow unused variables when underscore-prefixed.
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
lint.flake8-quotes.docstring-quotes = "double"
lint.flake8-quotes.inline-quotes = "double"
lint.flake8-quotes.multiline-quotes = "double"
lint.isort.no-sections = false
lint.isort.order-by-type = true
# Flag errors (`C901`) whenever the complexity level exceeds 5.
lint.mccabe.max-complexity = 20
lint.pydocstyle.convention = "google"
lint.pylint.max-args = 20

[tool.codespell]
ignore-words-list = "STrack,sTrack,strack"
skip = "*.ipynb"
count = true
quiet-level = 3

[tool.mypy]
mypy_path = "src"
explicit_package_bases = true
ignore_missing_imports = false
python_version = "3.10"
warn_unused_ignores = true
strict = true
overrides = [
  { module = [ "examples.*", "tests.*" ], ignore_errors = true },
  { module = [ "supervision._cv2" ], warn_unused_ignores = false },
]

[tool.pytest]
ini_options.testpaths = [ "src", "tests" ]
ini_options.norecursedirs = [ ".git", ".venv", "build", "dist", "docs", "examples", "notebooks" ]
ini_options.addopts = [
  "--doctest-modules",
  "--color=yes",
]
ini_options.filterwarnings = [
  "error::DeprecationWarning",
]
ini_options.doctest_optionflags = "ELLIPSIS NORMALIZE_WHITESPACE"

[tool.autoflake]
check = true
imports = [ "cv2", "supervision" ]