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

[project]
name = "tidb-fivetran-connector"
version = "0.1.0"
description = "Fivetran Connector SDK source connector for TiDB cloud storage sink data."
readme = "README.md"
requires-python = ">=3.13,<3.14"
dependencies = [
  "boto3==1.43.14",
  "botocore==1.43.14",
  "pydantic==2.13.4",
  "sqlglot==30.8.0",
]

[dependency-groups]
dev = [
  "fivetran-connector-sdk==2.8.3",
  "pre-commit>=4",
  { include-group = "lint" },
  { include-group = "test" },
  { include-group = "type" },
]
lint = [
  "ruff>=0.13",
]
test = [
  "pytest>=8.3",
  "pytest-cov>=6",
]
type = [
  "pyright>=1.1",
]

[tool.pytest.ini_options]
addopts = ["-ra", "--strict-config", "--strict-markers"]
pythonpath = ["."]
testpaths = ["tests"]

[tool.coverage.run]
branch = true
source = ["."]
omit = [
  ".venv/*",
  "scripts/*",
  "tests/*",
]

[tool.coverage.report]
precision = 1
show_missing = true
skip_covered = true

[tool.ruff]
line-length = 120
target-version = "py313"
exclude = [
  ".codegraph",
  ".uv-cache",
  ".venv",
  "ticdc_fivetran_connector.egg-info",
  "tidb_fivetran_connector.egg-info",
]

[tool.ruff.lint]
select = ["B", "E4", "E7", "E9", "F", "I", "RUF", "SIM", "UP"]

[tool.pyright]
pythonVersion = "3.13"
typeCheckingMode = "basic"
venvPath = "."
venv = ".venv"
include = [
  "app.py",
  "config.py",
  "connector.py",
  "csv_parser",
  "deployer",
  "errors.py",
  "fivetran",
  "increment",
  "observability.py",
  "snapshot",
  "state.py",
  "metadata",
  "pipeline",
  "storage",
  "type_mapping.py",
]
exclude = [
  ".codegraph",
  ".venv",
  "scripts",
  "tests",
]

[tool.setuptools]
py-modules = ["app", "config", "connector", "errors", "observability", "state", "type_mapping"]

[tool.setuptools.packages.find]
include = [
  "deployer",
  "deployer.*",
  "csv_parser",
  "csv_parser.*",
  "fivetran",
  "fivetran.*",
  "increment",
  "increment.*",
  "metadata",
  "metadata.*",
  "pipeline",
  "pipeline.*",
  "snapshot",
  "snapshot.*",
  "storage",
  "storage.*",
]
