#/usr/bin/env python
import io
import re
from setuptools import setup, find_packages


with io.open('./toga/__init__.py', encoding='utf8') as version_file:
    version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file.read(), re.M)
    if version_match:
        version = version_match.group(1)
    else:
        raise RuntimeError("Unable to find version string.")


with io.open('README.rst', encoding='utf8') as readme:
    long_description = readme.read()


setup(
    name='toga',
    version=version,
    description='A Python native, OS native GUI toolkit.',
    long_description=long_description,
    author='Russell Keith-Magee',
    author_email='russell@keith-magee.com',
    url='http://pybee.org/toga',
    packages=find_packages(exclude=['docs', 'tests']),
    package_data={
        'toga': ['resources/*.icns', 'resources/*.png'],
    },
    install_requires=[],
    extras_require={
        # Automatically installed platform backends
        ':sys_platform=="win32"': ['toga-win32'],
        ':sys_platform=="linux"': ['toga-gtk'],
        ':sys_platform=="linux2"': ['toga-gtk'],
        ':sys_platform=="darwin"': ['toga-cocoa'],

        # Manually requested platform backends
        'cocoa': ['toga-cocoa'],
        'gtk': ['toga-gtk'],
        'win32': ['toga-win32'],
        'ios': ['toga-iOS'],
        # 'android': ['toga-android'],
        # 'qt': ['toga-qt'],
    },
    license='New BSD',
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Topic :: Software Development',
        'Topic :: Software Development :: User Interfaces',
        'Topic :: Software Development :: Widget Sets',
    ],
    test_suite='tests',
)
