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

[project]
name = "pechub-worker"
version = "1.0.0"
description = "PEChub – Worker IMAP sync + background jobs"
requires-python = ">=3.12"

dependencies = [
    # Job queue
    "arq>=0.26.1",

    # Database (stessi driver del backend)
    "sqlalchemy>=2.0.36",
    "asyncpg>=0.29.0",
    "alembic>=1.13.0",

    # Configurazione
    "pydantic>=2.9.0",
    "pydantic-settings>=2.5.0",

    # Redis
    "redis[asyncio]>=5.0.0",

    # IMAP async
    "aioimaplib>=2.0.0",

    # SMTP async (invio PEC – Fase 4)
    "aiosmtplib>=3.0.0",

    # Storage MinIO/S3
    "miniopy-async>=1.21.0",

    # Sicurezza (stesso modulo del backend per decifratura credenziali)
    "cryptography>=43.0.0",
    "python-jose[cryptography]>=3.3.0",
    "bcrypt>=4.0.0",

    # Utilities
    "python-dotenv>=1.0.0",
    "email-validator>=2.2.0",

    # Full-text search: estrazione testo da allegati
    "pypdf>=4.0.0",
    "python-docx>=1.1.0",
    "openpyxl>=3.1.0",
    "python-pptx>=1.0.0",
    "odfpy>=1.4.1",
    "striprtf>=0.0.26",

    # OCR per allegati image-only (immagini dirette e PDF scansionati)
    "pytesseract>=0.3.13",
    "pdf2image>=1.17.0",
    "Pillow>=11.0.0",
]

[project.optional-dependencies]
dev = [
    "pytest>=8.3.0",
    "pytest-asyncio>=0.24.0",
    "pytest-cov>=5.0.0",
    "anyio>=4.6.0",
    "ruff>=0.7.0",
    "mypy>=1.13.0",
]

[tool.setuptools.packages.find]
where = ["."]
include = ["app*"]

[tool.ruff]
target-version = "py312"
line-length = 100
src = ["app", "tests"]

[tool.ruff.lint]
select = ["E", "W", "F", "I", "B", "C4", "UP"]
ignore = ["E501", "B008", "B904"]

[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
filterwarnings = [
    "ignore::DeprecationWarning",
    "ignore::PendingDeprecationWarning",
]
