"""
PyInstaller hook for pydantic — force collection of all pydantic submodules.

pydantic_core is a PyO3 Rust extension (.pyd/.so). pydantic itself is pure Python
but imports pydantic_core at the C level. Without this hook, PyInstaller only
bundles the compiled extension but not the Python package, causing ABI mismatch
and PyO3 panic at runtime.
"""
from PyInstaller.utils.hooks import collect_submodules, collect_data_files

# Force collect ALL pydantic submodules as source (not just PYZ)
hiddenimports = collect_submodules('pydantic')
hiddenimports += collect_submodules('pydantic_core')

# Also collect version-specific data files
datas = collect_data_files('pydantic')
datas += collect_data_files('pydantic_core')
