import os

from setuptools import find_packages, setup

from app_utils import __version__

# read the contents of your README file
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, "README.md"), encoding="utf-8") as f:
    long_description = f.read()

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

on_rtd = os.environ.get("READTHEDOCS") == "True"
if on_rtd:
    INSTALL_REQUIRES = []
else:
    INSTALL_REQUIRES = ["allianceauth>=2.8.2"]

INSTALL_REQUIRES += ["requests"]

setup(
    name="allianceauth-app-utils",
    version=__version__,
    packages=find_packages(),
    include_package_data=True,
    license="MIT",
    description="Commonly used utility functions and classes for rapid development of Alliance Auth apps.",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://gitlab.com/ErikKalkoken/allianceauth-app-utils",
    author="Erik Kalkoken",
    author_email="kalkoken87@gmail.com",
    classifiers=[
        "Environment :: Web Environment",
        "Framework :: Django",
        "Framework :: Django :: 3.2",
        "Framework :: Django :: 4.0",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Programming Language :: Python",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Topic :: Internet :: WWW/HTTP",
        "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
    ],
    python_requires="~=3.8",
    install_requires=INSTALL_REQUIRES,
)
