<commit_before><commit_msg>Add setup.py file<commit_after># -*- coding: utf-8 -*-
from codecs import open
import re
from setuptools import setup


def read_attributes(string, *names):
    regex_tpl = r'^__{}__\s*=\s*[\'"]([^\'"]*)[\'"]'

    def read(name):
        regex = regex_tpl.format(name)
        return re.search(regex, string, re.MULTILINE).group(1)

    return [read(n) for n in names]

with open('main.py', 'r') as fd:
    content = fd.read()
    name, version, author, email, _license = read_attributes(
        content,
        'title',
        'version',
        'author',
        'email',
        'license'
    )

with open('README.rst', 'r', 'utf-8') as f:
    readme = f.read()


install_requires = [
    'Flask',
    'Flask-SQLAlchemy',
    'Flask-WTF',
    'cached-property',
    'spam-lists'
]

tests_require = ['nose-parameterized']

setup(
    name=name,
    version=version,
    description='A url shortener application',
    long_description=readme,
    author=author,
    author_email=email,
    url='https://github.com/piotr-rusin/url-shortener',
    packages=['url_shortener', 'test', 'test.unit'],
    package_data={
        'url_shortener': ['templates/*.html'],
    },
    include_package_data=True,
    install_requires=install_requires,
    license=_license,
    classifiers=(
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Flask',
        'Natural Language :: English',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python :: 3.4',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Internet :: WWW/HTTP :: Site Management',
        'Topic :: Internet :: WWW/HTTP :: Site Management :: Link Checking'
    ),
    keywords='url-shortener',
    tests_require=tests_require,
    extras_require={
        'test': tests_require,
        'dev': ['pylint', 'restview']
    },
)
{'fraction_non_alphanumeric': 0.1596766043456291, 'fraction_numerical': 0.003031834259727135, 'mean_word_length': 2.800383877159309, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1704655', 'n_tokens_mistral': 644, 'n_tokens_neox': 628, 'n_words': 140}