Exemplo n.º 1
0
def main(args=None):
    """Main script entry point"""
    oparser = OptionParser()
    oparser.add_option("--distribute", action="store_true", default=False, help="Use Distribute instead of Setuptools")
    oparser.add_option(
        "--clear", action="store_true", default=False, help="Clear out the non-root install and start " "from scratch"
    )
    oparser.add_option("--debug", action="store_true")
    opts, args = oparser.parse_args(args)

    setup_logging(opts.debug)
    home_dir = os.environ.get("HOLLAND_HOME", expanduser("~/holland-test"))
    if home_dir in sys.executable:
        logging.error("Please exit your current virtual environment before trying to create another")
        return 1

    create_environment(
        home_dir, site_packages=True, clear=opts.clear, unzip_setuptools=False, use_distribute=opts.distribute
    )
    virtualenv = make_env(home_dir)
    egg_env = find_egg_env(os.path.join(home_dir, "lib", "python2.4", "site-packages"))
    if "holland" in egg_env:
        logging.info("'holland' found in environment. Not reinstalling.")
    else:
        install_holland(virtualenv)
    install_plugins(virtualenv, egg_env)

    install_configs(home_dir)
    result = start_shell(virtualenv)
    logging.info("Exiting virtual environment[%d]", result)
    return result
Exemplo n.º 2
0
def main(args=None):
    """Main script entry point"""
    oparser = OptionParser()
    oparser.add_option('--distribute', action='store_true',
                       default=False,
                       help='Use Distribute instead of Setuptools')
    oparser.add_option('--clear', action='store_true',
                       default=True,
                       help='Clear out the non-root install and start '
                            'from scratch')
    oparser.add_option('--debug', action='store_true')
    opts, args = oparser.parse_args(args)

    setup_logging(opts.debug)
    home_dir = os.environ.get('HOLLAND_HOME', expanduser('~/holland-test'))
    if home_dir in sys.executable:
        logging.error("Please exit your current virtual environment before trying to create another")
        return 1

    create_environment(home_dir, site_packages=True, clear=opts.clear,
                       unzip_setuptools=False, use_distribute=opts.distribute)
    virtualenv = make_env(home_dir)
    install_holland(virtualenv)
    install_addons(virtualenv)
    install_plugins(virtualenv)
    install_configs(home_dir)
    install_testutils(virtualenv)
    run_tests(virtualenv)
    return 0