[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "agrobr"
version = "0.12.0"
description = "Dados agrícolas brasileiros em uma linha de código"
readme = "README.md"
license = "MIT"
requires-python = ">=3.11"
authors = [
    { name = "Bruno", email = "bruno@example.com" }
]
keywords = [
    "agro",
    "agricultura",
    "abiove",
    "anp",
    "antaq",
    "antt",
    "pedagio",
    "mapa",
    "psr",
    "seguro-rural",
    "cepea",
    "conab",
    "deral",
    "ibge",
    "imea",
    "usda",
    "commodities",
    "soja",
    "milho",
    "brasil",
    "dados",
    "scraping",
]
classifiers = [
    "Development Status :: 3 - Alpha",
    "Intended Audience :: Developers",
    "Intended Audience :: Science/Research",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Topic :: Scientific/Engineering",
    "Topic :: Office/Business :: Financial",
    "Typing :: Typed",
]
dependencies = [
    "httpx>=0.25.0",
    "beautifulsoup4>=4.12.0",
    "lxml>=5.0.0",
    "pandas>=2.0.0",
    "pydantic>=2.5.0",
    "pydantic-settings>=2.1.0",
    "duckdb>=1.4.4",
    "structlog>=23.2.0",
    "chardet>=5.2.0",
    "typer>=0.9.0",
    "openpyxl>=3.1.0",
    "xlrd>=2.0.1",
    "sidrapy>=0.1.4",
]

[project.optional-dependencies]
browser = [
    "playwright>=1.40.0",
]
pdf = [
    "pdfplumber>=0.10.0",
]
bigquery = [
    "basedosdados>=2.0.0",
]
polars = [
    "polars>=0.19.0",
]
geo = [
    "geopandas>=0.14.0",
]
dev = [
    "pytest>=7.4.0",
    "pytest-asyncio>=0.21.0",
    "pytest-cov>=4.1.0",
    "pytest-recording>=0.13.0",
    "pytest-timeout>=2.2.0",
    "ruff>=0.4.0",
    "mypy>=1.7.0",
    "black>=23.11.0",
    "pre-commit>=3.5.0",
    "pandas-stubs>=2.0.0",
    "xlwt>=1.3.0",
]
docs = [
    "mkdocs>=1.5.0",
    "mkdocs-material>=9.5.0",
    "mkdocstrings[python]>=0.24.0",
]
all = [
    "agrobr[polars,browser,pdf,bigquery,geo,dev,docs]",
]

[project.scripts]
agrobr = "agrobr.cli:app"

[project.urls]
Homepage = "https://www.agrobr.dev"
Documentation = "https://www.agrobr.dev/docs/"
Repository = "https://github.com/bruno-portfolio/agrobr"
Issues = "https://github.com/bruno-portfolio/agrobr/issues"

[tool.hatch.build.targets.wheel]
packages = ["agrobr"]

[tool.ruff]
target-version = "py311"
line-length = 100

[tool.ruff.lint]
select = [
    "E",      # pycodestyle errors
    "W",      # pycodestyle warnings
    "F",      # Pyflakes
    "I",      # isort
    "B",      # flake8-bugbear
    "C4",     # flake8-comprehensions
    "UP",     # pyupgrade
    "ARG",    # flake8-unused-arguments
    "SIM",    # flake8-simplify
]
ignore = [
    "E501",   # line too long (handled by black)
    "B008",   # do not perform function calls in argument defaults
    "B905",   # zip without strict
]

[tool.ruff.lint.isort]
known-first-party = ["agrobr"]

[tool.mypy]
python_version = "3.11"
strict = true
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 = false
warn_no_return = true
follow_imports = "normal"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "tests.*"
ignore_errors = true

[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
addopts = "-q --tb=short -m 'not benchmark and not slow'"
filterwarnings = [
    "ignore::DeprecationWarning",
]
markers = [
    "slow: marks tests as slow (deselect with '-m \"not slow\"')",
    "integration: marks tests that require network access",
    "benchmark: marks scalability/performance benchmarks (deselect with '-m \"not benchmark\"')",
]

[tool.coverage.run]
source = ["agrobr"]
branch = true

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "def __repr__",
    "raise NotImplementedError",
    "if TYPE_CHECKING:",
    "if __name__ == .__main__.:",
]

[tool.black]
line-length = 100
target-version = ["py311"]
