File setup.py of Package google-cloud-sdk.1615

#!/usr/bin/env python
"""Setup module for google-cloud-sdk."""

import glob
import os
import sys


try:
    import setuptools
except ImportError:
    sys.stderr.write('Python setuptools required, please install.')
    sys.exit(1)

print sys.argv

if __name__ == '__main__':
    os.system('rm -rf lib/google/apputils')
    allPckgs = glob.glob('lib/*')
    excludePckgs = []
    for name in  allPckgs:
        if (name.find('google') != -1
            or name.find('protorpc') != -1
            or name.find('fancy_urllib') != -1):
            continue
        # Creating an exclude list is unreliable, some packages still
        # get pushed into site-packages. Remove the code instead
        os.system('rm -rf %s' %name)
        # excludePckgs.append(name.split(os.sep)[-1])

    pkg = setuptools.find_packages('lib',exclude=excludePckgs)
    setuptools.setup(
        name='google-cloud-sdk',
        description=(
            'Command-line tool for interacting with Google Cloud Platform'),
        url='https://developers.google.com/cloud/sdk/',
        license='Apache 2',
        author='Google',
        author_email='google-cloud-sdk@googlegroups.com',
        version='0.9.87',
        packages=setuptools.find_packages('lib',exclude=excludePckgs),
        package_data={
            'googlecloudsdk' : [os.path.join('core', '*.json'),
                                os.path.join('core', 'credentials', '*.html')],
        },
        package_dir={
            '': 'lib',
        },
  )