[project]
name = "meshy"
version = "26.06"
description = "A GTK4/libadwaita client for MeshCore"
readme = "README.md"
requires-python = ">=3.13"
dependencies = []

[dependency-groups]
dev = [
    "pre-commit>=4.6.0",
    "pycryptodome>=3.23.0",
    "pyserial>=3.5",
    "pytest>=8.0",
    "pyzbar>=0.1.9",
    "ruff>=0.15.15",
    "segno>=1.6.6",
]

dev-linux = [
    "pyzbar>=0.1.9",  # Requires libzbar (Linux)
]

dev-macos = [
    "pyobjc-framework-CoreBluetooth>=10.0",
    "pyobjc-framework-CoreLocation>=10.0",
    "pyobjc-framework-AVFoundation>=10.0",
    "pyobjc-framework-Vision>=10.0",
    "pyobjc-framework-UserNotifications>=10.0",  # Requires signed builds
]

[tool.pytest.ini_options]
testpaths = ["tests"]

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

[tool.ruff.lint]
select = [
    "E",      # pycodestyle errors
    "W",      # pycodestyle warnings
    "F",      # pyflakes
    "I",      # isort
    "UP",     # pyupgrade
    "B",      # flake8-bugbear
    "SIM",    # flake8-simplify
    "PIE",    # flake8-pie
]
ignore = [
    "E501",   # line too long (handled by formatter)
    "E402",   # module level import not at top (required for gi.require_version)
    "E701",   # multiple statements on one line (colon) - compact code style
    "E702",   # multiple statements on one line (semicolon) - index increment pattern
    "E731",   # lambda assignments - valid for GTK signal handlers
    "F821",   # undefined name '_' - gettext is injected by GTK builtins
    "F841",   # unused variable - often intentional (unpacking, callbacks)
    "B007",   # unused loop control variable - itertools pattern
    "SIM102", # nested if - more readable in complex conditionals
    "SIM103", # needless bool - explicit is better than implicit
    "SIM105", # suppressible exception - contextlib not always clearer
    "SIM108", # if-else-block - ternary not always more readable
    "SIM118", # in dict.keys() - explicit for readability
]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]  # unused imports in __init__ files
