# -------------------------------------------
from setuptools import setup, find_packages
import pathlib

# The directory containing this file
HERE = pathlib.Path(__file__).parent

# The text of the README file
README = (HERE / "README.md").read_text(encoding="utf-8")

# 1. TOUTES LES DÉPENDANCES (Installation complète par défaut)
# Un seul bloc pour que 'pip install rostaingchain' installe TOUT.
install_all_requirements = [
    # --- CORE & ORCHESTRATION ---
    "langchain",
    "langchain-community",
    "langchain-core",
    "langchain-text-splitters",
    "python-dotenv",
    "watchdog",
    "markdown",
    "tabulate",

    # --- LLM PROVIDERS ---
    "langchain-ollama",
    "langchain-openai",
    "langchain-anthropic",
    "langchain-google-genai",
    "langchain-groq",
    "langchain-mistralai",
    "langchain-huggingface",
    "huggingface-hub",

    # --- VECTOR DATABASES & EMBEDDINGS ---
    "chromadb",
    "langchain-chroma",
    "faiss-cpu",
    "qdrant-client",
    "fastembed",
    "sentence-transformers",
    "hf-xet",
    "hf-transfer",
    "langchain-qdrant",
    "qdrant-client",

    # --- DATA SCIENCE & DEEP PROFILING (Anti-Hallucination) ---
    "pandas",
    "numpy",
    "scipy",
    "polars",
    "fastexcel",
    "matplotlib",
    "seaborn",

    # --- DATABASE CONNECTORS (SQL, NoSQL, Graph) ---
    "sqlalchemy",
    "pyodbc",
    "pymssql",
    "psycopg2-binary",
    "psycopg",
    "pymysql",
    "pymongo",
    "neo4j",

    # --- DOCUMENTS & OCR ---
    "rostaing-ocr",
    "python-docx",
    "openpyxl",
    "python-pptx",
    "unstructured",
    "beautifulsoup4",
    "html2text",

    # --- MULTIMEDIA & VOICE ---
    "openai-whisper",
    "moviepy",
    "soundfile",
    "youtube-transcript-api",
    "pytube",
    "pyttsx3",
    "whisper",
]

setup(
    name="rostaingchain",
    version="1.2.0",
    description="The Ultimate Agentic RAG Framework.",
    long_description=README,
    long_description_content_type="text/markdown",
    url="https://github.com/Rostaing/rostaingchain",
    author="Davila Rostaing",
    author_email="rostaingdavila@gmail.com",
    license="MIT",
    
    # Compatibilité Python étendue
    python_requires='>=3.9',
    
    classifiers=[
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Programming Language :: Python :: 3.12",
        "Programming Language :: Python :: 3.13",
        "Operating System :: OS Independent",
        "Topic :: Scientific/Engineering :: Artificial Intelligence",
        "Intended Audience :: Developers",
    ],
    
    packages=find_packages(),
    include_package_data=True,
    
    # Tout est ici pour une installation en une seule commande
    install_requires=install_all_requirements,
    
    # On garde ceci pour la rétrocompatibilité ou des usages très spécifiques
    extras_require={
        "all": install_all_requirements,
        "oracle": ["cx-oracle"], # Laissé à part car nécessite un client lourd externe
    },
)


# # -------------------------------------------
# from setuptools import setup, find_packages
# import pathlib

# # The directory containing this file
# HERE = pathlib.Path(__file__).parent

# # The text of the README file
# README = (HERE / "README.md").read_text(encoding="utf-8")

# # 1. Dépendances OBLIGATOIRES (Le minimum vital pour que le framework démarre)
# core_requirements = [
#     "langchain",
#     "langchain-community",
#     "langchain-core",
#     "langchain-text-splitters",
#     "fastembed",      # Embeddings par défaut légers
#     "chromadb",       # DB par défaut
#     "faiss-cpu",
#     "langchain-chroma",
#     "pandas",
#     "numpy",
#     "scipy",          # NEW: For statistical tests
#     "matplotlib",     # NEW: For Deep Profiling Visuals
#     "seaborn",        # NEW: For Heatmaps/Advanced Viz
#     "markdown",
#     "watchdog",       # Surveillance fichiers
#     "python-dotenv",
#     "pyttsx3",        # Vocal basique
#     "pyodbc",
#     "polars",
#     "fastexcel",
#     "tabulate",
#     # LLM Providers
#     "langchain-ollama",
#     "langchain-openai",
#     "langchain-anthropic",
#     "langchain-google-genai",
#     "langchain-groq",
#     "langchain-mistralai",
#     "langchain-huggingface",
#     "huggingface-hub",
#     # Outils avancés HuggingFace
#     "hf-xet",
#     "hf-transfer",
#     "sentence-transformers",
#     "openai-whisper",
#     "whisper",
#     "qdrant-client",
# ]

# # 2. Dépendances OPTIONNELLES (À la carte)
# extra_requirements = {
#     # Pour utiliser les LLMs distants
#     # "llms": [
#     #     "langchain-ollama",
#     #     "langchain-openai",
#     #     "langchain-anthropic",
#     #     "langchain-google-genai",
#     #     "langchain-groq",
#     #     "langchain-mistralai",
#     #     "langchain-huggingface",
#     #     "huggingface-hub",
#     # ],
#     # Pour les bases de données (SQL, NoSQL, Graph)
#     "database": [
#         "sqlalchemy",
#         "pymongo",
#         "neo4j",
#         "psycopg2-binary", # Postgres
#         "pymssql",         # SQL Server
#         "pymysql",         # MySQL
#         "psycopg",
#         # "cx-oracle"      # Souvent complexe à installer (nécessite drivers OS), on le laisse dans 'all'
#     ],
#     # Pour les autres Vector Stores
#     "vectors": [
#         "qdrant-client",
#     ],
#     # Pour le Multimédia (YouTube, Audio, Vidéo, Web)
#     "media": [
#         "openai-whisper",
#         "moviepy",
#         "soundfile",
#         "youtube-transcript-api",
#         "pytube",
#         "beautifulsoup4",
#         "html2text",
#     ],
#     # Pour les documents bureautiques et l'OCR avancé
#     "docs": [
#         "rostaing-ocr",
#         "python-docx",
#         "openpyxl",
#         "python-pptx",
#         "unstructured",
#     ],
#     # Outils avancés HuggingFace
#     # "hf": [
#     #     "hf-xet",
#     #     "hf-transfer",
#     #     "sentence-transformers"
#     # ]
# }

# # Création d'une option "all" pour tout installer d'un coup
# # Cela combine toutes les listes ci-dessus + cx-oracle
# all_reqs = sum(extra_requirements.values(), []) + ["setuptools"]
# extra_requirements["all"] = all_reqs

# setup(
#     name="rostaingchain",
#     version="1.0.5",
#     description="The Ultimate Agentic RAG Framework.",
#     long_description=README,
#     long_description_content_type="text/markdown",
#     url="https://github.com/Rostaing/rostaingchain",
#     author="Davila Rostaing",
#     author_email="rostaingdavila@gmail.com",
#     license="MIT",
#     # --- AJOUT DE LA VERSION PYTHON REQUISE ---
#     python_requires='>=3.9',
#     classifiers=[
#         "License :: OSI Approved :: MIT License",
#         "Programming Language :: Python :: 3",
#         "Programming Language :: Python :: 3.9",
#         "Programming Language :: Python :: 3.10",
#         "Programming Language :: Python :: 3.11",
#         "Programming Language :: Python :: 3.12",
#         "Programming Language :: Python :: 3.13",
#         "Operating System :: OS Independent",
#         "Topic :: Scientific/Engineering :: Artificial Intelligence",
#     ],
#     packages=find_packages(),
#     include_package_data=True,
    
#     # Installation légère par défaut
#     install_requires=core_requirements,
    
#     # Installation complète ou modulaire
#     extras_require=extra_requirements,
# )