"""Package definition for PyPI."""
import os

from setuptools import setup

PROJECT_SLUG = "mbed-devices"
SOURCE_DIR = "mbed_devices"
__version__ = None

repository_dir = os.path.dirname(__file__)

# Read package version, this will set the variable `__version__` to the current version.
with open(os.path.join(repository_dir, SOURCE_DIR, "_version.py")) as fh:
    exec(fh.read())

# Use readme needed as long description in PyPI
with open(os.path.join(repository_dir, "README.md")) as fh:
    long_description = fh.read()

setup(
    author="Mbed team",
    author_email="support@mbed.com",
    classifiers=[
        "Development Status :: 3 - Alpha",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: Apache Software License",
        "Programming Language :: Python",
        "Programming Language :: Python :: 3 :: Only",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Topic :: Software Development :: Build Tools",
        "Topic :: Software Development :: Embedded Systems",
    ],
    description="This package allows to list Mbed OS devices which are connected to the host computer.",
    keywords="Arm Mbed OS MbedOS devices list",
    include_package_data=True,
    install_requires=[
        "python-dotenv",
        "Click==7.0",
        "mbed-targets",
        "mbed-tools-lib",
        "pywin32; platform_system=='Windows'",
        "psutil; platform_system=='Linux'",
        "pyudev; platform_system=='Linux'",
        "typing-extensions",
        "tabulate",
        "dataclasses; python_version<'3.7'",
    ],
    license="Apache 2.0",
    long_description_content_type="text/markdown",
    long_description=long_description,
    name=PROJECT_SLUG,
    packages=[SOURCE_DIR],
    python_requires=">=3.6,<4",
    url=f"https://github.com/ARMmbed/{PROJECT_SLUG}",
    version=__version__,
)
