<commit_before>#!/usr/bin/env python

# Require setuptools. See http://pypi.python.org/pypi/setuptools for
# installation instructions, or run the ez_setup script found at
# http://peak.telecommunity.com/dist/ez_setup.py
from setuptools import setup, find_packages, Command


class CheckCommand(Command):
    description = "Run tests."
    user_options = []

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self):
        import subprocess

        print "Running pep8..."
        if subprocess.call(["pep8", "cobe", "tests"]):
            return

        print "Running pyflakes..."
        if subprocess.call(["pyflakes", "cobe", "tests"]):
            return

        print "Running tests..."
        if subprocess.call(["coverage", "run", "--source=cobe,tests",
                            "./setup.py", "test"]):
            return

        subprocess.call(['coverage', 'report', '-m'])


setup(
    name = "cobe",
    version = "2.0.4",
    author = "<NAME>",
    author_email = "<EMAIL>",
    url = "http://wiki.github.com/pteichman/cobe/",
    description = "Markov chain based text generator library and chatbot",
    packages = ["cobe"],
    test_suite = "unittest2.collector",
<commit_msg>Exit with a nonzero code when failing pep8, pyflakes, or tests<commit_after>#!/usr/bin/env python

import sys

# Require setuptools. See http://pypi.python.org/pypi/setuptools for
# installation instructions, or run the ez_setup script found at
# http://peak.telecommunity.com/dist/ez_setup.py
from setuptools import setup, find_packages, Command


class CheckCommand(Command):
    description = "Run tests."
    user_options = []

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self):
        import subprocess

        print "Running pep8..."
        if subprocess.call(["pep8", "cobe", "tests"]):
            sys.exit("ERROR: failed pep8 checks")

        print "Running pyflakes..."
        if subprocess.call(["pyflakes", "cobe", "tests"]):
            sys.exit("ERROR: failed pyflakes checks")

        print "Running tests..."
        if subprocess.call(["coverage", "run", "--source=cobe,tests",
                            "./setup.py", "test"]):
            sys.exit("ERROR: failed unit tests")

        subprocess.call(['coverage', 'report', '-m'])


setup(
    name = "cobe",
    version = "2.0.4",
    author = "<NAME>",
    author_email = "<EMAIL>",
    url = "http://wiki.github.com/pteichman/cobe/",
    description = "Markov chain based text generator library and chatbot",
    packages = ["cobe"],
    test_suite = "unittest2.collector",

{'fraction_non_alphanumeric': 0.1444070332959222, 'fraction_numerical': 0.005237560793116348, 'mean_word_length': 2.5748663101604277, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '6751961', 'n_tokens_mistral': 831, 'n_tokens_neox': 801, 'n_words': 205}