<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from distutils.core import setup
import re
VERSIONFILE="ssc/_version.py"
verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
    verstr = mo.group(1)
else:
    raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))


setup(
    name='ssc',
    description='Simple Sound Codecs like Delta Modulation, ADM, etc',
    license='BSD',
    keywords='sound codec DM ADM BTC',
    version=verstr,
    long_description=open('README.rst').read(),

    author='<NAME>',
    author_email='<EMAIL>',
    url='https://github.com/Zardoz89/BTc-Sound-Codecs.git',

    packages=['ssc'],
)<commit_msg>test command implemented and working<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from distutils.core import Command, setup

import re
import sys

VERSIONFILE="ssc/_version.py"
verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
    verstr = mo.group(1)
else:
    raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))


METADATA = dict(
    name='ssc',
    description='Simple Sound Codecs like Delta Modulation, ADM, etc',
    license='BSD',
    keywords='sound codec DM ADM BTC',
    version=verstr,
    long_description=open('README').read(),

    author='<NAME>',
    author_email='<EMAIL>',
    url='https://github.com/Zardoz89/BTc-Sound-Codecs.git',

    packages=['ssc'],

    classifiers=[
        'Programming Language :: Python',
        'Classifier: License :: OSI Approved :: BSD License',
    ],
)

# test and 2to3 take from intelhex setup.py

class test(Command):
    description = "unittest for ssc"
    user_options = []
    boolean_options = []

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self):
        import unittest
        import ssc.test
        verbosity = 1
        if self.verbose:
            verbosity = 2
        suite = unittest.TestSuite()
        loader = unittest.TestLoader()
        suite.addTest(loader.loadTestsFromModule(ssc.test))
        runner = unittest.TextTestRunner(stream=sys.stdout, verbosity=verbosity)
        result = runner.run(suite)
        if result.errors or result.failures:
            return 1


def main():
    metadata = METADATA.copy()
    metadata['cmdclass'] = {
        'test': test,
        }
    if sys.version_info[0] >= 3:
        from distutils.command.build_py import build_py_2to3
        metadata['cmdclass']['build_py'] = build_py_2to3
        from distutils.command.build_scripts import build_scripts_2to3
        metadata['cmdclass']['build_scripts'] = build_scripts_2to3

    setup(**metadata)


if __name__ == '__main__':
    main()

{'fraction_non_alphanumeric': 0.14672765657987333, 'fraction_numerical': 0.00809289232934553, 'mean_word_length': 3.1564327485380117, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 2, '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': '755762', 'n_tokens_mistral': 950, 'n_tokens_neox': 916, 'n_words': 206}