#!/usr/bin/env python

from pathlib import Path

from setuptools import find_packages, setup


ROOT = Path(__file__).resolve().parent


def read_version() -> str:
    version_file = ROOT / "hawkSoar" / "version.py"
    namespace = {}
    exec(version_file.read_text(encoding="utf-8"), namespace)
    return namespace.get("__VERSION__", "1.0.0")


def read_long_description() -> str:
    readme_path = ROOT / "hawkSoar" / "README.md"
    if readme_path.exists():
        return readme_path.read_text(encoding="utf-8")
    return "HAWK SOAR Daemon"


setup(
    name="hawk-soard",
    version=read_version(),
    description="HAWK SOAR Daemon",
    long_description=read_long_description(),
    long_description_content_type="text/markdown",
    author="HAWK Network Defense, Inc.",
    author_email="support@hawkdefense.com",
    url="https://www.hawk.io/",
    packages=find_packages(include=["hawkSoar", "hawkSoar.*"]),
    include_package_data=True,
    scripts=["hawk-soard"],
    python_requires=">=3.8",
    install_requires=[
        "configparser",
        "python-dateutil",
        "requests",
        "ujson",
        "cryptography>=1.4.0",
        "pluginbase>=1.0.0",
        "kazoo",
        "kafka",
        "psutil",
        "dnspython",
        "traceroute",
        "python-whois",
        "ipwhois",
        "sqlalchemy",
        "websocket-client",
        "distro",
        "urllib3",
        "py-radix",
        "pysos",
        "PyMISP",
        "i18n",
    ],
    classifiers=[
        "Programming Language :: Python :: 3",
        "License :: Other/Proprietary License",
        "Operating System :: OS Independent",
    ],
)
