<commit_before>import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand

install_requires = (
    'Flask==0.10.1',
    'Flask-RESTful==0.2.12',
    'Jinja2==2.7.3',
    'Logbook==0.7.0',
    'MarkupSafe==0.23',
    'PyYAML==3.11',
    'SQLAlchemy==0.9.7',
    'Werkzeug==0.9.6',
    'ago==0.0.6',
    'aniso8601==0.83',
    'blessings==1.5.1',
    'facterpy==0.1',
    'itsdangerous==0.24',
    'jsonschema==2.3.0',
    'six==1.7.3',
)

tests_require = (
    'cov-core==1.15.0',
    'coverage==3.7.1',
    'mock==1.0.1',
    'py==1.4.26',
    'pytest==2.6.4',
    'pytest-cov==1.8.1',
    'pytz==2014.10',
    'tox==1.8.0',
    'virtualenv==1.11.6',
)


class PyTest(TestCommand):
    def finalize_options(self):
        TestCommand.finalize_options(self)
        self.test_args = [
            'test',
            '-v',
            '--cov=piper',
            '--cov-report=xml',
            '--cov-report=term-missing',
            '--result-log=pytest-results.log'
        ]
        self.test_suite = True

    def run_tests(self):
        import pytest
        errno = pytest.main(self.test_args)<commit_msg>Refactor version setup in setup.py<commit_after>import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand


# http://stackoverflow.com/questions/11472810/#14405269
install_requires = (
    'Flask<=0.10.1,<1.0.0a0',
    'Flask-RESTful<=0.3.2,<1.0.0a0',
    'Jinja2<=2.7.3,<3.0.0a0',
    'Logbook<=0.9.0,<1.0.0a0',
    'MarkupSafe<=0.23,<1.0a0',
    'PyYAML<=3.11,<4.0a0',
    'SQLAlchemy==0.9.7',  # Purposefully on hold
    'Werkzeug<=0.10.4,<1.0.0a0',
    'ago<=0.0.6,<1.0.0a0',
    'aniso8601<=0.83,<1.0.0a0',
    'blessings<=1.6,<2.0.0a0',
    'facterpy<=0.1,<1.0a0',
    'itsdangerous<=0.24,<1.0a0',
    'jsonschema>=2.3.0,<3.0.0a0',
    'six>=1.9.0,<2.0.0a0',
)

tests_require = (
    'cov-core',
    'coverage',
    'mock',
    'py',
    'pytest',
    'pytest-cov',
    'pytz',
    'tox',
    'virtualenv',
)


class PyTest(TestCommand):
    def finalize_options(self):
        TestCommand.finalize_options(self)
        self.test_args = [
            'test',
            '-v',
            '--cov=piper',
            '--cov-report=xml',
            '--cov-report=term-missing',
            '--result-log=pytest-results.log'
        ]
        self.test_suite = True

    def run_tests(self):
        import pytest
        errno = pytest.main(self.test_args)
{'fraction_non_alphanumeric': 0.20285714285714285, 'fraction_numerical': 0.08244897959183674, 'mean_word_length': 2.250663129973475, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1099610', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1057, 'n_words': 123}