#!/usr/bin/env python

"""A setuptools based setup module.
"""

from setuptools import setup, find_packages
import os

here = os.path.abspath(os.path.dirname(__file__))

packages = ['bsr']

requires = [
    'requests>=2.19.1',
    'urllib3>=1.21.1',
]

about = {}
with open(os.path.join(here, 'bsr', '__version__.py'), 'r') as f:
    exec(f.read(), about) # pylint: disable=exec-used

with open('README.md', 'r') as f:
    readme = f.read()

def package_files(directory):
    paths = []
    for (path, directories, filenames) in os.walk(directory):
        for filename in filenames:
            paths.append(os.path.join('..', path, filename))
    return paths

extra_files = package_files('bsr/web_dist')

setup(
    name=about['__title__'],
    version=about['__version__'],
    description=about['__description__'],
    long_description=readme,
    long_description_content_type='text/markdown',
    author=about['__author__'],
    author_email=about['__author_email__'],
    url=about['__url__'],
    packages=find_packages(),
    scripts=['bsr/bsr'],
    package_data={
        '': ['LICENSE', 'NOTICE'] + extra_files,
        'requests': ['*.pem']
        },
    package_dir={'bsr': 'bsr'},
    include_package_data=True,
    python_requires=">=2.7.17, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
    install_requires=requires,
    license=about['__license__'],
    zip_safe=False,
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.17',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: Implementation :: CPython',
        'Programming Language :: Python :: Implementation :: PyPy'
    ],
    project_urls={
        'Documentation': about['__url__'],
        'Source': about['__url__'],
    },
)

