setup.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:larissa 作者: bannsec 项目源码 文件源码
def _install_boost():
    """Determine if we need to install liboost, and do so."""

    # If it's already installed, don't install it.
    if _get_boost_path() != None:

        # Caveat, it has to be a high enough version...
        major, minor, patch = _get_boost_version(_get_boost_path())

        if major > 1:
            return

        if major == 1 and minor >= 55:
            return

    print("Installing boost.")

    # Looks like we need to build it
    try:
        #out = subprocess.check_output("pip install -vvv larissa_boost",shell=True)
        # No idea why setup.py correctly installs larissa_boost in this case where pip does not.
        os.system("pip download larissa_boost")
        os.system("tar xf larissa_boost*")
        _, names, _ = next(os.walk("."))
        os.chdir([name for name in names if "larissa_boost" in name][0])
        out = subprocess.check_output("python setup.py install",shell=True)
    except Exception as e:
        raise Exception(e.output)

    print(out)
    print(os.system("ls -la $VIRTUAL_ENV/"))
    print(os.system("ls -la $VIRTUAL_ENV/include/"))
    print(os.system("ls -la $VIRTUAL_ENV/boost/"))
    print(os.system("ls -la $VIRTUAL_ENV/boost/include"))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号