MCPcopy Create free account
hub / github.com/apache/impala / download_toolchain_python

Function download_toolchain_python

infra/python/bootstrap_virtualenv.py:211–231  ·  view source on GitHub ↗

Grabs the Python implementation from the Impala toolchain, using the machinery from bin/bootstrap_toolchain.py. Skip the download if SKIP_TOOLCHAIN_BOOTSTRAP=true in the environment. In that case only the presence of the Python executable is checked in the toolchain location.

()

Source from the content-addressed store, hash-verified

209
210
211def download_toolchain_python():
212 '''Grabs the Python implementation from the Impala toolchain, using the machinery from
213 bin/bootstrap_toolchain.py.
214 Skip the download if SKIP_TOOLCHAIN_BOOTSTRAP=true in the environment. In that case
215 only the presence of the Python executable is checked in the toolchain location.
216 '''
217
218 toolchain_packages_home = os.environ.get("IMPALA_TOOLCHAIN_PACKAGES_HOME")
219 if not toolchain_packages_home:
220 raise Exception("Impala environment not set up correctly, make sure "
221 "$IMPALA_TOOLCHAIN_PACKAGES_HOME is set.")
222
223 package = ToolchainPackage("python")
224 if package.needs_download() and \
225 not (os.environ.get(SKIP_TOOLCHAIN_BOOTSTRAP) == 'true'):
226 package.download()
227 python_cmd = os.path.join(package.pkg_directory(), "bin/python3")
228 if not os.path.exists(python_cmd):
229 raise Exception("Unexpected error bootstrapping python from toolchain: {0} does not "
230 "exist".format(python_cmd))
231 return python_cmd
232
233
234def install_deps(venv_dir):

Callers 1

create_virtualenvFunction · 0.85

Calls 8

needs_downloadMethod · 0.95
downloadMethod · 0.95
ToolchainPackageClass · 0.90
pkg_directoryMethod · 0.80
getMethod · 0.65
joinMethod · 0.45
existsMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected