[project]
name = "iwa"
version = "0.0.33"
description = "A secure, modular, and plugin-based framework for crypto agents and ops"
readme = "README.md"
requires-python = ">=3.12,<4.0"
dependencies = [
    "bip-utils>=2.9.3",
    "cryptography>=46.0.2",
    "eth-account>=0.13.7",
    "loguru>=0.7.3",
    "pydantic>=2.12.0",
    "pydantic-settings>=2.11.0",
    "rich>=14.2.0",
    "tomli>=2.3.0",
    "tomli-w>=1.2.0",
    "typer>=0.19.2",
    "web3>=7.13.0",
    "pyyaml (>=6.0.3,<7.0.0)",
    "safe-eth-py>=7.14.0",
    "twine>=6.2.0",
    "cowdao-cowpy>=1.0.1",
    "pytest>=9.0.1",
    "textual>=0.47.1",
    "pyperclip>=1.8.2",
    "peewee>=3.17.0",
    "fastapi>=0.115.0",
    "uvicorn>=0.32.0",
    "jinja2>=3.1.4",
    "cbor2==5.8.0",
    "slowapi>=0.1.9",
    "nest-asyncio>=1.6.0",
    "aiohttp>=3.13.3",
    "pynacl>=1.6.2",
    "urllib3>=2.6.3",
    "multiformats>=0.3.1",
    "requests>=2.32.0",
]

[project.scripts]
iwa = "iwa.core.cli:iwa_cli"
iwa-wallet-check = "iwa.tools.wallet_check:check_wallet"
iwa-reset-tenderly = "iwa.tools.reset_tenderly:main"
iwa-reset-env = "iwa.tools.reset_env:main"
iwa-check-profile = "iwa.tools.check_profile:main"

[dependency-groups]
dev = [
    "mypy>=1.18.2",
    "ruff>=0.14.1",
    "twine>=6.2.0",
    "pytest-cov>=6.0.0",
    "pytest-asyncio>=0.23.0",
    "mkdocs>=1.6.1",
    "mkdocs-material>=9.5.49",
    "mkdocstrings[python]>=0.27.0",
    "bandit>=1.9.2",
    "pip-audit>=2.10.0",
    "djlint>=1.34.1",
]

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

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
"*" = ["*.json", "*.yaml", "*.yml", "*.html", "*.css", "*.js"]

[tool.ruff]
line-length = 100
target-version = "0.0.33"
fix = true

[tool.ruff.lint]
extend-select = ["I", "B", "C90", "N", "D"]  # imports, bugbear, complexity, naming, docstrings
ignore = [
    "E501",
    "D203",
    "D213",
    "D400",  # First line should end with a period
    "D401", # First line should be in imperative mood
    "D415",  # First line should end with a period, question mark, or exclamation point
]

[tool.ruff.lint.per-file-ignores]
"src/tests/**/*.py" = ["D", "E402"]
"tests/**/*.py" = ["D", "E402"]

[tool.ruff.format]
quote-style = "double"
indent-style = "space"

# strict = true
[tool.mypy]
check_untyped_defs = true
disallow_untyped_defs = false
ignore_missing_imports = true
follow_imports = "silent"
exclude = [
    "pydantic_core",
    "typing_inspection",
    "src/tests/.*",
    "tests/.*",
    "src/iwa/tools/.*",
    "src/iwa/tui/.*", # TUI is often complex with types, delaying check for speed
    "src/iwa/plugins/olas/scripts/.*", # Integration test scripts, not production code
]

[[tool.mypy.overrides]]
module = [
    "bip_utils.*",
    "cowdao_cowpy.*",
    "eth_account.*",
    "loguru.*",
    "peewee.*",
    "playhouse.*",
    "pydantic.*",
    "pydantic_core.*",
    "pyperclip.*",
    "pytest.*",
    "rich.*",
    "safe_eth.*",
    "textual.*",
    "tomli_w.*",
    "typer.*",
    "web3.*",
    "iwa.plugins.*",
    "iwa.tui.*",
    "iwa.core.*",
    "iwa.*",
    "iwa.tools.*",
    "tests.*",
]
ignore_missing_imports = true
ignore_errors = true
follow_imports = "skip"

[tool.bandit]
exclude_dirs = ["tests", "src/tests", "src/iwa/plugins/olas/tests"]
skips = ["B101", "B105", "B106", "B110", "B107", "B112"]
[tool.djlint]
profile = "jinja"
extension = "html"
indent = 4
