content: [build-system]
  requires = ["setuptools", "wheel", "pybind11", "setuptools-rust"]
  build-backend = "setuptools.build_meta"
  
  [tool.setuptools]
  package-dir = {"" = "src"}
  include-package-data = true
  zip-safe = false
  
  [tool.setuptools.packages.find]
  where = ["src"]
  include = ["datumaro*"]
  
  [tool.setuptools.dynamic]
  version = {attr = "datumaro.version.__version__"}
  
  [tool.pybind11.ext_modules]
  "datumaro._capi" = { sources = ["src/datumaro/capi/pybind.cpp"], extra_compile_args = ["-O3"] }
  
  [[tool.setuptools-rust.ext-modules]]
  target = "datumaro.rust_api"
  path = "rust/Cargo.toml"
  binding = "PyO3"
  
  [project]
  name = "datumaro"
  dynamic = ["version"]
  description = "Dataset Management Framework (Datumaro)"
  authors = [
      {name = "Intel", email = "emily.chun@intel.com"}
  ]
  license = {text = "MIT"}
  readme = "README.md"
  requires-python = ">=3.10"
  classifiers = [
      "Programming Language :: Python :: 3",
      "Operating System :: OS Independent",
  ]
  dependencies = [
      "attrs>=21.3.0",
      "defusedxml>=0.7.0",
      "imagesize>=1.4.1",
      "lxml<7,>=5.2.0",
      "numpy<2.3",
      "orjson>=3.10.0",
      "Pillow>=10.3.0",
      "ruamel.yaml>=0.17.0",
      "shapely>=1.7",
      "typing_extensions>=3.7.4.3",
      "tqdm>=4.67.1",
      "pycocotools>=2.0.4",
      "PyYAML==6.0.3",
      "pandas>=1.4.0",
      "pyarrow",
      "json-stream",
      "opencv-python-headless>=4.11.0.86",
  ]
  
  [project.scripts]
  datum = "datumaro.cli.__main__:main"
  
  [project.urls]
  Homepage = "https://github.com/open-edge-platform/datumaro"
  
  [project.optional-dependencies]
  dev = [
      "pre-commit",
      "ruff",
  ]
  
  test = [
      "pytest>=5.3.5",
      "pytest-cov>=4.0.0",
      "pytest-stress",
      "pytest-html",
      "coverage",
      "pytest-csv",
      "dill",
      "tifffile",
  ]
  
  # Tensorflow support
  # Exclude Tensorflow from Python 3.13 as it is not supported yet
  # Also exclude TensorFlow from the MacOS checks due to the following issue:
  # https://github.com/tensorflow/tensorflow/issues/98563
  tf = [
      "tensorflow; python_version < '3.13' and sys_platform != 'darwin'",
  ]
  # TODO: Reenable tfds
  #tfds = [
  #    "tensorflow-datasets; python_version < '3.13' and sys_platform != 'darwin'",
  #    "absl-py>=0.12.0; python_version < '3.13' and sys_platform != 'darwin'",
  #]
  
  # PyTorch support
  torch = ["torch", "torchvision"]
  
  # Kaggle download support
  kaggle = ["kaggle"]
  
  # NDR, mpii file format, missing value detection in tabular data
  scipy = ["scipy"]
  
  # Tabular data processing
  nlp = ["nltk", "tokenizers", "portalocker"]
  
  # Comparator
  tabulate = ["tabulate"]
  
  # Any dependencies needed by the CLI
  # 2.3 has an unlisted dependency on PyTorch, which we don't need
  cli = ["tensorboardX>=1.8,!=2.3", "tabulate", "scipy", "matplotlib>=3.3.1"]
  
  # Visualizer
  visualizer = ["matplotlib>=3.3.1"]
  
  # NYU Depth Dataset v2 file format
  h5py = ["h5py>=2.10.0"]
  
  # BraTS file format
  nibabel = ["nibabel>=3.2.1"]
  
  # AVA dataset
  protobuf = ["protobuf"]
  
  experimental = ["polars>=1.31.0,<2.0.0"]
  
  [tool.isort]
  profile = "black"
  forced_separate = ["tests"]
  line_length = 100
  
  [tool.coverage.run]
  branch = true
  
  source = [
      "src/",
  ]
  
  omit = [
      "src/datumaro/__main__.py",
      "src/datumaro/version.py",
      "tests/*",
  ]
  
  [tool.cibuildwheel]
  # reference docs - https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
  build = "cp310-*_x86_64 cp311-*_x86_64 cp312-*_x86_64 cp313-*_x86_64 cp310-*_amd64 cp311-*_amd64 cp312-*_amd64 cp313-*_amd64 cp310-*_arm64 cp311-*_arm64 cp312-*_arm64 cp313-*_arm64"
  
  [tool.cibuildwheel.linux]
  before-all = [
      "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup-init.sh",
      "sh ./rustup-init.sh -y --default-toolchain stable --profile minimal"
  ]
  
  environment = { PATH="$HOME/.cargo/bin:$PATH" }
  
  [tool.coverage.report]
  # Regexes for lines to exclude from consideration
  exclude_lines = [
      # Have to re-enable the standard pragma
      'pragma: no cover',
  
      # Don't complain about missing debug-only code:
      'def __repr__',
      'if\s+[\w\.()]+\.isEnabledFor\(log\.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 for the type checking code:
      'if TYPE_CHECKING:'
  ]
  
  # don't fail on the code that can be found
  ignore_errors = true
  
  skip_empty = true
  
  [tool.black]
  line-length = 100
  target-version = ['py310']
  
  [tool.ruff]
  # Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
  select = ["E", "F"]
  
  # Need to review all ignore items below
  ignore = [
      # pycodestyle
      "E402",     # module-import-not-at-top-of-file
      "E731",     # lambda-assignment
      "E741",     # ambiguous-variable-name
      #Pyflakes
      "F403",     # undefined-local-with-import-star
  ]
  
  # Allow autofix for all enabled rules (when `--fix`) is provided.
  fixable = ["A", "B", "C", "D", "E", "F"]
  unfixable = []
  
  # Exclude a variety of commonly ignored directories.
  exclude = [
      ".bzr",
      ".direnv",
      ".eggs",
      ".git",
      ".hg",
      ".mypy_cache",
      ".nox",
      ".pants.d",
      ".pytype",
      ".ruff_cache",
      ".svn",
      ".venv",
      "__pypackages__",
      "_build",
      "buck-out",
      "build",
      "dist",
      "node_modules",
      "venv",
  ]
  
  extend-exclude = [
      "src/datumaro/plugins/openvino_plugin/samples"
  ]
  
  # Same as Black.
  line-length = 120
  
  # Allow unused variables when underscore-prefixed.
  dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
  
  # minimum target version
  target-version = "py310"
  
  # ignore-init-module-imports = true
  
  [tool.ruff.mccabe]
  # Unlike Flake8, default to a complexity level of 10.
  max-complexity = 10
  
  [tool.ruff.per-file-ignores]
  "__init__.py" = [
      "F401"      # unused-import
  ]
  "src/datumaro/plugins/data_formats/ava/ava_label_pb2.py" = [
      "E501"      # line-too-long
  ]
  
  [tool.nbqa.addopts]
  ruff = ["--ignore=E402"]
  
  [tool.bandit]
  exclude_dirs = [
    '.vscode/',
    '.git/',
    'build/',
    'tests/',
  ]
  tests = [ 'B301', 'B302', 'B303', 'B304', 'B305', 'B306', 'B308', 'B310', 'B311', 'B312', 'B313', 'B314', 'B315', 'B316', 'B317', 'B318', 'B319', 'B321', 'B323', 'B324', 'B401', 'B402', 'B403', 'B404', 'B405', 'B406', 'B407', 'B408', 'B409', 'B411', 'B412', 'B413']
  