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.
()
| 209 | |
| 210 | |
| 211 | def 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 | |
| 234 | def install_deps(venv_dir): |
no test coverage detected