blob: d8fae821ba0ca193c11a58175cf46e9acc473865 [file] [log] [blame]
#!/usr/bin/env bash
# This script uses MESOS_SOURCE_DIR and MESOS_BUILD_DIR which come
# from configuration substitutions.
MESOS_SOURCE_DIR=@abs_top_srcdir@
MESOS_BUILD_DIR=@abs_top_builddir@
# Use colors for errors.
. ${MESOS_SOURCE_DIR}/support/colors.sh
# Force the use of the Python interpreter configured during building.
test ! -z "${PYTHON}" && \
echo "${RED}Ignoring PYTHON environment variable (using @PYTHON@)${NORMAL}"
PYTHON=@PYTHON@
SETUPTOOLS=`echo ${MESOS_BUILD_DIR}/3rdparty/setuptools-*/`
# Just warn in the case when build with --disable-bundled.
test ! -e ${SETUPTOOLS} && \
echo "${RED}Failed to find ${SETUPTOOLS}${NORMAL}"
PROTOBUF=`echo ${MESOS_BUILD_DIR}/3rdparty/protobuf-*/python/`
test ! -e ${PROTOBUF} && \
echo "${RED}Failed to find ${PROTOBUF}${NORMAL}"
MESOS_EGGS=$(find ${MESOS_BUILD_DIR}/src/python/dist -name "*.egg" | tr "\\n" ":")
SCRIPT=${MESOS_SOURCE_DIR}/src/examples/python/test_executor.py
test ! -e ${SCRIPT} && \
echo "${RED}Failed to find ${SCRIPT}${NORMAL}" && \
exit 1
PYTHONPATH="${SETUPTOOLS}:${PROTOBUF}:${MESOS_EGGS}" \
PYTHON_EGG_CACHE="${MESOS_SANDBOX}/.python-eggs" \
exec ${PYTHON} ${SCRIPT} "${@}"