本文整理汇总了Python中driver.Driver.drive_install方法的典型用法代码示例。如果您正苦于以下问题:Python Driver.drive_install方法的具体用法?Python Driver.drive_install怎么用?Python Driver.drive_install使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类driver.Driver
的用法示例。
在下文中一共展示了Driver.drive_install方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: drive_install
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import drive_install [as 别名]
def drive_install(self):
self.check_call(["sudo", "apt-get", "update"])
self.check_call(["sudo", "apt-get", "install", "gfortran"])
self.check_call([
"wget", "--no-check-certificate", "--progress=dot",
"https://cmake.org/files/v3.5/cmake-3.5.0-Linux-x86_64.tar.gz"
])
self.check_call(["tar", "xzf", "cmake-3.5.0-Linux-x86_64.tar.gz"])
self.check_call([
"sudo", "rsync", "-avz", "cmake-3.5.0-Linux-x86_64/", "/usr/local"
])
Driver.drive_install(self)
示例2: drive_install
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import drive_install [as 别名]
def drive_install(self):
cmake_version = "3.5"
cmake_os = "Linux"
if self.is_darwin:
cmake_os = "Darwin"
cmake_name = "cmake-{}.0-{}-x86_64".format(cmake_version, cmake_os)
cmake_package = ".".join((cmake_name, "tar", "gz"))
self.log("Downloading", cmake_package)
self.check_call([
"wget", "--no-check-certificate", "--progress=dot",
"https://cmake.org/files/v{}/{}".format(
cmake_version, cmake_package)
])
self.log("Extracting", cmake_package)
self.check_call(["tar", "xzf", cmake_package])
if self.is_darwin:
prefix = "/usr/local/bin"
self.log("Removing any existing CMake in", prefix)
self.check_call(
["sudo", "rm", "-f"] + [
"/".join((prefix, subdir)) for subdir in
("cmake", "cpack", "cmake-gui", "ccmake", "ctest")
]
)
self.log("Installing CMake in", prefix)
self.check_call([
"sudo",
cmake_name + "/CMake.app/Contents/bin/cmake-gui",
"--install"
])
self.check_call(
"\n".join((
"brew update",
"brew outdated pyenv || brew upgrade pyenv",
"eval \"$( pyenv init - )\"",
"pyenv install " + self.py_version,
"pyenv local " + self.py_version,
"echo 'Python Version:'",
(
"python -c \""
"import sys, struct ; "
"print(sys.version) ; "
"print('{}-bit'.format(struct.calcsize('P') * 8))"
"\""
),
(
"pip install "
"--user --disable-pip-version-check --user --upgrade "
"pip"
),
"pip install --user -r requirements.txt",
"pip install --user -r requirements-dev.txt",
)),
shell=True
)
else:
self.log("Copying", cmake_name, "to /usr/local")
self.check_call([
"sudo", "rsync", "-avz", cmake_name + "/", "/usr/local"])
Driver.drive_install(self)