[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[tool.black]
# Google Python Style Guide Configuration for Black
line-length = 80
target-version = ['py38']
include = '\.pyi?$'
extend-exclude = '''
/(
  # directories
  \.eggs
  | \.git
  | \.hg
  | \.mypy_cache
  | \.tox
  | \.venv
  | venv
  | _build
  | buck-out
  | build
  | dist
  # ML experiment code - exclude from formatting
  | podman/workspace
  | workspace
  | tests/fixtures/examples
  | tests/fixtures/podman
  | results
  | data
  | logs
  | secrets
  | .agent
)/
'''

[tool.isort]
# Google Python Style Guide Configuration for isort
profile = "google"
line_length = 80
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
split_on_trailing_comma = true
known_first_party = ["fetch_ml"]
skip_glob = [
    "podman/workspace/*",
    "workspace/*",
    "tests/fixtures/examples/*",
    "tests/fixtures/podman/*",
]

[tool.mypy]
# Google Python Style Guide Configuration for mypy
python_version = "3.8"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true

[[tool.mypy.overrides]]
module = [
    "torch.*",
    "tensorflow.*", 
    "sklearn.*",
    "pandas.*",
    "numpy.*",
    "matplotlib.*",
    "seaborn.*",
    "scipy.*",
    "joblib.*",
]
ignore_missing_imports = true

[tool.pytest.ini_options]
# Google Python Style Guide Configuration for pytest
minversion = "6.0"
addopts = "-ra -q --strict-markers --strict-config"
testpaths = ["tests"]
python_files = ["*_test.py", "test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
    "slow: marks tests as slow (deselect with '-m \"not slow\"')",
    "integration: marks tests as integration tests",
    "unit: marks tests as unit tests",
]

[tool.coverage.run]
source = ["."]
omit = [
    "tests/*",
    "*/tests/*",
    "test_*",
    "*_test.py",
    "setup.py",
    "*/site-packages/*",
    # ML experiment code
    "podman/workspace/*",
    "workspace/*",
    "tests/fixtures/examples/*",
    "tests/fixtures/podman/*",
    "results/*",
    "data/*",
    "logs/*",
    "secrets/*",
    ".agent/*",
]

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "def __repr__",
    "if self.debug:",
    "if settings.DEBUG",
    "raise AssertionError",
    "raise NotImplementedError",
    "if 0:",
    "if __name__ == .__main__.:",
    "class .*\\bProtocol\\):",
    "@(abc\\.)?abstractmethod",
]
