content: # ╔═══════╗
  # ║ tests ║
  # ╚═══════╝
  [tool.pytest.ini_options]
  minversion = "6.0"
  # Since `--doctest-modules` requires specifying `dapper`,
  # it means pytest won't discover `test` dir on its own.
  # So to run all tests, do `pytest tests`.
  addopts = """
      --ignore=tests/test_plotting.py
      --ignore=tests/test_demos.py
  --doctest-modules dapper
      --ignore-glob=**/QG/*
      --ignore-glob=**/magic.py
      --ignore-glob=**/autoscaler.py
      --ignore-glob=**/demo.py
      --ignore-glob=**/illust_*.py
      --ignore-glob=dapper/mods/KS/compare_schemes.py
      --ignore=dapper/mods/explore_props.py
  """
  # mpl uses distutils (deprecated in python>=3.10).
  # The warning only prints via pytest.
  # Silence until mpl is upgraded (when Colab does so).
  filterwarnings = [
      'ignore:distutils:DeprecationWarning',
  ]
  
  [tool.coverage.run]
  branch = true # stricter
  source = ["dapper"]
  #omit = ["bad_file.py"]
  
  [tool.coverage.report]
  ignore_errors = true
  exclude_lines = [
      "pragma: no cover",
      "def __repr__",
      "if self.debug",
      "raise AssertionError",
      "raise NotImplementedError",
      "if 0:",
      "if __name__ == .__main__.:"
  ]
  
  [tool.tox]
  legacy_tox_ini = """
  [tox]
  envlist = py3{7,8,9}
  toxworkdir={homedir}/.tox
  
  [testenv]
  platform = linux|darwindeps
  deps = {toxinidir}
  extras = test
  setenv =
      IS_TOX = true
  commands =
      pytest {posargs}
  """
  
  
  # ╔══════╗
  # ║ ruff ║
  # ╚══════╝
  [tool.ruff]
  # Exclude a variety of commonly ignored directories.
  exclude = [
      "scripts",
      ".git",
      ".ipynb_checkpoints",
      ".pyenv",
      ".pytest_cache",
      ".ruff_cache",
      ".svn",
      ".tox",
      ".venv",
      ".vscode",
      "__pypackages__",
      "build",
      "dist",
      "site-packages",
      "venv",
      ".*", "README.*", "docs/examples/*", "autoscaler.py",
  ]
  
  # Same as Black.
  line-length = 88
  indent-width = 4
  
  # Assume Python 3.9
  target-version = "py39"
  
  [tool.ruff.lint]
  select = [
      "E",      # pycodestyle
      "F",      # Pyflakes
      "UP",     # pyupgrade
      "B",      # flake8-bugbear
      # "SIM",  # flake8-simplify
      "I",      # isort
  ]
  
  # Allow fix for all enabled rules (when `--fix`) is provided.
  fixable = ["ALL"]
  unfixable = []
  
  # Allow unused variables when underscore-prefixed.
  dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
  
  ignore = [
    "B905",  # zip w/o explicit `strict=` (active if target-version>=3.10)
  ]
  
  [tool.ruff.lint.per-file-ignores]
  "dapper/da_methods/{ensemble,variational}.py" = [
  "B023" # Function definition does not bind loop variable
  ]
  "tests/test_{example_2,data}.py" = [
    "E501", # "line too long"
    "W291", # "trailing whitespace"
  ]
  "**/__init__.py" = [
    "F401", # "imported but unused"
    "E402", # "module level import not at top of file"
  ]
  
  [tool.ruff.format]
  quote-style = "double"
  indent-style = "space"
  skip-magic-trailing-comma = false
  line-ending = "auto"
  docstring-code-format = false
  docstring-code-line-length = "dynamic"
  