def fake_setuptools_modules():
    """
    Created a bunch of stub setuptools modules
    """
    setuptools_modules = [
        'setuptools',
        'setuptools.command',
        'setuptools.command.alias',
        'setuptools.command.bdist_egg',
        'setuptools.command.bdist_rpm',
        'setuptools.command.bdist_wininst',
        'setuptools.command.build_ext',
        'setuptools.command.build_py',
        'setuptools.command.develop',
        'setuptools.command.easy_install',
        'setuptools.command.egg_info',
        'setuptools.command.install',
        'setuptools.depends.install_egg_info',
        'setuptools.command.install_lib',
        'setuptools.command.install_scripts',
        'setuptools.command.register',
        'setuptools.command.rotate',
        'setuptools.command.saveopts',
        'setuptools.command.sdist',
        'setuptools.command.setopt',
        'setuptools.command.test',
        'setuptools.command.upload',
        'setuptools.command.upload_docs',
        'setuptools.extern',
        'setuptools.dist',
        'setuptools.extension',
        'setuptools.launch',
        'setuptools.lib2to3_ex',
        'setuptools.msvc9_support',
        'setuptools.package_index',
        'setuptools.py26compat',
        'setuptools.py27compat',
        'setuptools.py31compat',
        'setuptools.sandbox',
        'setuptools.site-patch',
        'setuptools.ssl_support',
        'setuptools.unicode_utils',
        'setuptools.utils',
        'setuptools.version',
        'setuptools.windows_support',
        # 'pkg_resources',
        # 'pkg_resources.extern',
    ]

    for m in setuptools_modules:
        fake_module(m)

    # First import importable distutils
    import distutils.command
    import distutils.core
    import distutils.util
    distutils_command_modules = [
        'distutils.command.bdist'
        'distutils.command.bdist_dumb',
        'distutils.command.bdist_msi',
        'distutils.command.bdist_rpm',
        'distutils.command.bdist_wininst',
        'distutils.command.build',
        'distutils.command.build_clib',
        'distutils.command.build_ext',
        'distutils.command.build_py',
        'distutils.command.build_scripts',
    ]
    for m in distutils_command_modules:
        fake_module(m)
    sys.modules['distutils.util'].get_platform = OmniClass()
    # fix for new problem in issue 169
    sys.modules['distutils.command.build_ext'].sub_commands = []
    sys.modules['setuptools.command.build_ext'].sub_commands = []

    Created a bunch of stub setuptools modules
    
bin/pip.py