<commit_before>import os
import shutil
import subprocess
import sys

from setuptools import setup, find_packages, Command

src_dir = 'src/python'
package_directory = 'cloudfoundry_client'
package_name = 'cloudfoundry-client'
loggregator_dir = 'loggregator'
sys.path.insert(0, os.path.realpath(src_dir))

version_file = '%s/%s/__init__.py' % (src_dir, package_directory)
with open(version_file, 'r') as f:
    for line in f.readlines():
        if line.find('__version__') >= 0:
            exec line
            break
    else:
        raise AssertionError('Failed to load version from %s' % version_file)


def purge_sub_dir(path):
    shutil.rmtree(os.path.join(os.path.dirname(__file__), path))


class GenerateCommand(Command):
    description = "generate protobuf class generation"
    user_options = []

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self):
        source_path = os.path.join(os.path.dirname(__file__), src_dir, package_directory, loggregator_dir)
        for file_protobuf in os.listdir(source_path):
            if file_protobuf.endswith('.proto'):
                print('Generating %s' % file_protobuf)
                subprocess.call(['protoc', '-I', source_path, '--python_out=%s' % source_path,
                                 os.path.join(source_path, file_protobuf)])


setup(name=package_name,
      version=__version__,
      zip_safe=True,
      packages=find_packages(where=src_dir),
      author='<NAME>',
      author_email='<EMAIL>',
      description='A client library for CloudFoundry',
      long_description=open('README.md').read(),
      url='http://github.com/antechrestos/cf-python-client',
      classifiers=[
          "Programming Language :: Python",
          "Natural Language :: English",
          "Operating System :: OS Independent",
          "Programming Language :: Python :: 2.7",
          "Topic :: Communications",
      ],
      entry_points={
          'console_scripts': [
              'cloudfoundry-client = %s.main:main' % package_directory,
          ]
      },
      cmdclass=dict(generate=GenerateCommand),
      package_dir={package_directory: '%s/%s' % (src_dir, package_directory)},
      install_requires=[requirement.rstrip(' \r\n') for requirement in open('requirements.txt')],
      tests_require=[line.rstrip() for line in open('test/requirements.txt')],
      test_suite='test',
      )<commit_msg>fix #7: pip install broken by 5e5d45e<commit_after>import os
import shutil
import subprocess
import sys

from setuptools import setup, find_packages, Command

src_dir = 'src/python'
package_directory = 'cloudfoundry_client'
package_name = 'cloudfoundry-client'
loggregator_dir = 'loggregator'
sys.path.insert(0, os.path.realpath(src_dir))

version_file = '%s/%s/__init__.py' % (src_dir, package_directory)
with open(version_file, 'r') as f:
    for line in f.readlines():
        if line.find('__version__') >= 0:
            exec line
            break
    else:
        raise AssertionError('Failed to load version from %s' % version_file)


def purge_sub_dir(path):
    shutil.rmtree(os.path.join(os.path.dirname(__file__), path))


class GenerateCommand(Command):
    description = "generate protobuf class generation"
    user_options = []

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self):
        source_path = os.path.join(os.path.dirname(__file__), src_dir, package_directory, loggregator_dir)
        for file_protobuf in os.listdir(source_path):
            if file_protobuf.endswith('.proto'):
                print('Generating %s' % file_protobuf)
                subprocess.call(['protoc', '-I', source_path, '--python_out=%s' % source_path,
                                 os.path.join(source_path, file_protobuf)])


setup(name=package_name,
      version=__version__,
      zip_safe=True,
      packages=find_packages(where=src_dir),
      author='<NAME>',
      author_email='<EMAIL>',
      description='A client library for CloudFoundry',
      long_description=open('README.md').read(),
      url='http://github.com/antechrestos/cf-python-client',
      classifiers=[
          "Programming Language :: Python",
          "Natural Language :: English",
          "Operating System :: OS Independent",
          "Programming Language :: Python :: 2.7",
          "Topic :: Communications",
      ],
      entry_points={
          'console_scripts': [
              'cloudfoundry-client = %s.main:main' % package_directory,
          ]
      },
      cmdclass=dict(generate=GenerateCommand),
      package_dir={package_directory: '%s/%s' % (src_dir, package_directory)},
      install_requires=[requirement.rstrip(' \r\n') for requirement in open('requirements.txt')],
      tests_require=[
          'mock==2.0.0',
      ],
      test_suite='test',
      )
{'fraction_non_alphanumeric': 0.1254355400696864, 'fraction_numerical': 0.003279360524697684, 'mean_word_length': 2.961038961038961, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1704228', 'n_tokens_mistral': 1474, 'n_tokens_neox': 1444, 'n_words': 293}