import sys
from setuptools import setup, find_packages

with open("README.md", "r") as fh:
    readme = fh.read()

with open("CHANGELOG.md", "r", encoding="utf-8") as fh:
    changelog = fh.read()

long_description = readme + "\n\n" + changelog

install_requires = [
    'aiosignal==1.3.1',
    'anyio==4.3.0',
    'argon2-cffi==23.1.0',
    'argon2-cffi-bindings==21.2.0',
    'arrow==1.3.0',
    # ... (other packages) ...
    'grpcio==1.66.1',
    'imutils',
    'keras',
    'h11==0.14.0',
    'httpcore==1.0.5',
    'httpx==0.27.0',
    'idna==3.6',
    'ipykernel',
    'ipython',
    'isoduration==20.11.0',
    'iterators==0.0.2',
    'jedi==0.19.1',
    'Jinja2==3.1.3',
    'json5==0.9.25',
    'jsonpointer==2.4',
    'jsonschema==4.21.1',
    'jsonschema-specifications==2023.12.1',
    'jupyter-lsp',
    'jupyter_client',
    'jupyter_core',
    'jupyter_server',
    'jupyter_server_terminals',
    'jupyterlab',
    'jupyterlab_pygments',
    'jupyterlab_server',
    'kiwisolver==1.4.5',
    'markdown-it-py',
    'MarkupSafe==2.1.4',
    'matplotlib',
    'matplotlib-inline==0.1.7',
    'mdurl==0.1.2',
    'mistune==3.0.2',
    'mpmath==1.3.0',
    'msgpack==1.0.7',
    'nbclient==0.10.0',
    'nbconvert==7.16.4',
    'nbformat==5.10.4',
    'nest-asyncio==1.6.0',
    'networkx',
    'notebook_shim==0.2.4',
    'numpy',
    'overrides==7.7.0',
    'packaging==23.2',
    'pandas',
    'pandocfilters==1.5.1',
    'parso==0.8.4',
    'pexpect==4.9.0',
    'pillow==10.2.0',
    'protobuf',
    'platformdirs==4.2.2',
    'prometheus_client==0.20.0',
    'prompt-toolkit==3.0.43',
    'psutil==5.9.8',
    'ptyprocess==0.7.0',
    'pure-eval==0.2.2',
    'py-markdown-table==0.4.0',
    'pyarrow',
    'pybind11-global==2.11.1',
    'pycparser==2.21',
    'pycryptodome==3.20.0',
    'Pygments==2.18.0',
    'pyparsing==3.1.1',
    'python-dateutil==2.8.2',
    'python-json-logger==2.0.7',
    'pytz==2023.3.post1',
    'PyYAML',
    'referencing==0.32.1',
    'requests==2.31.0',
    'rfc3339-validator==0.1.4',
    'rfc3986-validator==0.1.1',
    'rich==13.7.1',
    'rpds-py==0.17.1',
    'Send2Trash==1.8.3',
    'shellingham==1.5.4',
    'six==1.16.0',
    'sniffio==1.3.1',
    'soupsieve==2.5',
    'stack-data==0.6.3',
    'sympy==1.12',
    'terminado==0.18.1',
    'tinycss2==1.3.0',
    'tomli==2.0.1',
    'torch',
    'torchvision',
    'tornado',
    'tqdm',
    'traitlets==5.14.3',
    'typer==0.9.4',
    'types-python-dateutil==2.9.0.20240316',
    'typing_extensions',
    'tzdata==2023.4',
    'uri-template==1.3.0',
    'urllib3==2.1.0',
    'wcwidth==0.2.13',
    'webcolors==1.13',
    'webencodings==0.5.1',
    'websocket-client==1.8.0',
]

# Add conditional TensorFlow installation based on platform
if sys.platform == "darwin":  # macOS
    install_requires.append('tensorflow-macos==2.13.0')
    install_requires.append('tensorflow-metal')
else:  # Other platforms, such as Linux (e.g., Colab)
    install_requires.append('tensorflow==2.13.0')

setup(
    name="cifer",
    version="0.1.19",
    author="cifer.ai",
    author_email="parit@cifer.ai",
    description="Federated Learning and Fully Homomorphic Encryption",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://www.cifer.ai",
    license="Apache License 2.0",
    packages=find_packages(),
    package_dir={'client': 'Client'},
    install_requires=install_requires,  # Use the conditional install_requires
    tests_require=[
        'coverage', 'wheel', 'pytest', 'requests_mock'
    ],
    classifiers=[
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.8",  
        "License :: OSI Approved :: Apache Software License",
        "Development Status :: 3 - Alpha",  
        "Intended Audience :: Developers",
        "Operating System :: OS Independent",
    ]
)
