# setup.py
import os
from setuptools import setup, Extension
from setuptools.dist import Distribution
from setuptools_rust import RustExtension
from Cython.Build import cythonize
import numpy

class BinaryDistribution(Distribution):
    def has_ext_modules(self):
        return True
with open("README.md", encoding="utf-8") as f:
    long_description = f.read()  # This reads the actual text inside the file


extensions = [
    Extension(
        "AbstractOptimizedModules", 
        ["AbstractOptimizedModules.pyx"], 
        include_dirs=[numpy.get_include()],
        optional=True,
    )
]

setup(
    name="AbstractIntegratedModule",
    version="0.9.1",
    description="Library for Advanced Integrated Non-LLM AI Models - Optimized Backend Framework For Non-LLM AI Agent",
    long_description=long_description,
    long_description_content_type="text/markdown",
    author="Micro-Novelty",
    author_email="hernikpuspita5@gmail.com",
    license="MIT",
    py_modules=["AbstractIntegratedModule"],  # single file,
    ext_modules=cythonize(extensions, language_level=3),
    rust_extensions=[
        RustExtension(
            "AbstractIntegratedModule.rust_module",   # compiled Rust fast-path
            path="C:/users/dell/onedrive/desktop/AIM-PIP-Packaging/abstract_model_storage/Cargo.toml",
            binding="pyo3",
            optional=True,
        ),
    ],    
    distclass=BinaryDistribution,
    python_requires="> 3.9",
    install_requires=[
        "numpy>=1.21.0",
        "scikit-learn>=1.0.0",
        "pandas>=1.3.0",
        "joblib>=1.1.0",
        "cryptography>=41.0.0",
        "aiohttp>=3.8.0",
        "psutil>=5.9.0",
    ],
    classifiers=[
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Programming Language :: Python :: 3.12",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
    ],
)