<commit_before>"""Use the following command to install retriever: python setup.py install"""

from setuptools import setup
import platform

p = platform.platform().lower()
extra_includes = []
if "darwin" in p:
    try: import py2app
    except ImportError: pass
    extra_includes = []
elif "win" in p:
    try: import py2exe
    except ImportError: pass
    import sys
    extra_includes = ['pyodbc', 'inspect']
    sys.path.append("C:\\Windows\\winsxs\\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91")
from __init__ import VERSION


def clean_version(v):
    if v == 'master':
        return '1.0.0'
    return v.replace('v', '').replace('.rc', '').replace('.beta', '')

packages = [
            'retriever.lib',
            'retriever.engines',
            'retriever.app',
            'retriever',
            ]

includes = [
            'xlrd',
            'wx',
            'pymysql',
            'psycopg2',
            'sqlite3',
            ] + extra_includes
            
excludes = [
            'pyreadline',
            'doctest',
            'optparse',
            'getopt',
            'pickle',
            'calendar',
            'pdb',
            'inspect',
            'email',
            'pywin', 'pywin.debugger',
            'pywin.debugger.dbgcon',
            'pywin.dialogs', 'pywin.dialogs.list',
            'Tkconstants', 'Tkinter', 'tcl',
            ]


setup(name='retriever',
      version=clean_version(VERSION),
      description='EcoData Retriever',
      author='<NAME>',
      author_email='<EMAIL>',
      url='http://www.ecodataretriever.org',
      packages=packages,
      package_dir={
                'retriever':''
                },
      entry_points={
        'console_scripts': [
            'retriever = retriever.__main__:main',
        ],
      },
      install_requires=[
                        'xlrd',
                        ],

      # py2exe flags
      console = [{'script': "__main__.py",
                  'dest_base': "retriever",
                  'icon_resources':[(1,'icon.ico')]
                  }],
      zipfile = None,

      # py2app flags
      app=['__main__.py'],
      data_files=[('', ['CITATION'])],
      setup_requires=['py2app'] if 'darwin' in p else [],

      # options
      # optimize is set to 1 of py2app to avoid errors with pymysql
      options = {'py2exe': {'bundle_files': 1,
                            'compressed': 2,
                            'optimize': 2,
                            'packages': packages,
                            'includes': includes,
                            'excludes': excludes,
                            },
                 'py2app': {'packages': ['retriever'],
                            'includes': includes,
                            'site_packages': True,
                            'resources': [],
                            'optimize': 1,
                            'argv_emulation': True,
                            'no_chdir': True,
                            },
                },
      )


try:
    from compile import compile<commit_msg>Move to bundle_files = 3<commit_after>"""Use the following command to install retriever: python setup.py install"""

from setuptools import setup
import platform

p = platform.platform().lower()
extra_includes = []
if "darwin" in p:
    try: import py2app
    except ImportError: pass
    extra_includes = []
elif "win" in p:
    try: import py2exe
    except ImportError: pass
    import sys
    extra_includes = ['pyodbc', 'inspect']
    sys.path.append("C:\\Windows\\winsxs\\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91")
from __init__ import VERSION


def clean_version(v):
    if v == 'master':
        return '1.0.0'
    return v.replace('v', '').replace('.rc', '').replace('.beta', '')

packages = [
            'retriever.lib',
            'retriever.engines',
            'retriever.app',
            'retriever',
            ]

includes = [
            'xlrd',
            'wx',
            'pymysql',
            'psycopg2',
            'sqlite3',
            ] + extra_includes
            
excludes = [
            'pyreadline',
            'doctest',
            'optparse',
            'getopt',
            'pickle',
            'calendar',
            'pdb',
            'inspect',
            'email',
            'pywin', 'pywin.debugger',
            'pywin.debugger.dbgcon',
            'pywin.dialogs', 'pywin.dialogs.list',
            'Tkconstants', 'Tkinter', 'tcl',
            ]


setup(name='retriever',
      version=clean_version(VERSION),
      description='EcoData Retriever',
      author='<NAME>',
      author_email='<EMAIL>',
      url='http://www.ecodataretriever.org',
      packages=packages,
      package_dir={
                'retriever':''
                },
      entry_points={
        'console_scripts': [
            'retriever = retriever.__main__:main',
        ],
      },
      install_requires=[
                        'xlrd',
                        ],

      # py2exe flags
      console = [{'script': "__main__.py",
                  'dest_base': "retriever",
                  'icon_resources':[(1,'icon.ico')]
                  }],
      zipfile = None,

      # py2app flags
      app=['__main__.py'],
      data_files=[('', ['CITATION'])],
      setup_requires=['py2app'] if 'darwin' in p else [],

      # options
      # optimize is set to 1 of py2app to avoid errors with pymysql
      # bundle_files = 1 or 2 was causing failed builds so we moved
      # to bundle_files = 3 and Inno Setup
      options = {'py2exe': {'bundle_files': 3,
                            'compressed': 2,
                            'optimize': 2,
                            'packages': packages,
                            'includes': includes,
                            'excludes': excludes,
                            },
                 'py2app': {'packages': ['retriever'],
                            'includes': includes,
                            'site_packages': True,
                            'resources': [],
                            'optimize': 1,
                            'argv_emulation': True,
                            'no_chdir': True,
                            },
                },
      )


try:
    from compile import compile
{'fraction_non_alphanumeric': 0.12830604534005038, 'fraction_numerical': 0.015428211586901764, 'mean_word_length': 1.3829707426856714, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5536194', 'n_tokens_mistral': 1887, 'n_tokens_neox': 1796, 'n_words': 367}