# -*- coding: utf-8 -*-

import re
import os

try:
    from setuptools import setup
except ImportError:
    from ez_setup import use_setuptools
    use_setuptools()
    from setuptools import setup


def get_version(package):
    """
    Return package version as listed in `__version__` in `init.py`.
    """
    init_py = open(os.path.join(package, '__init__.py')).read()
    return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)

setup(
    name='django-mongo-connection',
    version=get_version('mongo_connection'),
    description='Simple connection wrapper for Mongoengine',
    long_description='Define Mongoengine connections in settings.py and make sure they\'re available when needed.',
    author='Rolf Håvard Blindheim',
    author_email='rhblind@gmail.com',
    url='https://github.com/inonit/django-mongo-connection',
    download_url='https://github.com/inonit/django-mongo-connection.git',
    license='MIT License',
    packages=[
        'mongo_connection',
    ],
    include_package_data=True,
    install_requires=[
        'Django>=1.8.0',
        'mongoengine>=0.10.6'
    ],
    tests_require=[
        'nose',
        'coverage'
    ],
    zip_safe=False,
    test_suite='tests.run_tests.start',
    classifiers=[
        'Operating System :: OS Independent',
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ]
)
