Repository: mesos Updated Branches: refs/heads/master ed27acff4 -> 9c146e3de
Install Python libraries during make install. Because eggs are impossible to uninstall, pip + wheel has been added as a packaging format. The wheels are generated in addition to eggs and then subsequently installed/uninstalled. Note that the building of eggs has not been removed. This is because wheels cannot be run in place like eggs are via. modification of PYTHONPATH. The eggs are needed for all the test scripts to run correctly without actually installing anything locally. Review: https://reviews.apache.org/r/24264 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/9c146e3d Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/9c146e3d Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/9c146e3d Branch: refs/heads/master Commit: 9c146e3dee60022a3cf05e048c3cbd89dd024882 Parents: ed27acf Author: Thomas Rampelberg <[email protected]> Authored: Mon Oct 6 10:08:16 2014 -0700 Committer: Benjamin Hindman <[email protected]> Committed: Mon Oct 6 10:11:11 2014 -0700 ---------------------------------------------------------------------- 3rdparty/Makefile.am | 19 +++-- 3rdparty/pip-1.5.6.tar.gz | Bin 0 -> 938120 bytes 3rdparty/versions.am | 2 + 3rdparty/wheel-0.24.0.tar.gz | Bin 0 -> 50597 bytes Makefile.am | 7 ++ configure.ac | 96 +++++++++++++++++++++++++ mpi/mpiexec-mesos.in | 35 +++------ src/Makefile.am | 86 +++++++++++++++++----- src/examples/python/test-containerizer.in | 39 +++------- src/examples/python/test-executor.in | 39 +++------- src/examples/python/test-framework.in | 39 +++------- 11 files changed, 221 insertions(+), 141 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/9c146e3d/3rdparty/Makefile.am ---------------------------------------------------------------------- diff --git a/3rdparty/Makefile.am b/3rdparty/Makefile.am index 7cf0c88..6621a69 100644 --- a/3rdparty/Makefile.am +++ b/3rdparty/Makefile.am @@ -34,12 +34,16 @@ include versions.am DISTRIBUTE = distribute-$(DISTRIBUTE_VERSION) LEVELDB = leveldb +PIP = pip-$(PIP_VERSION) +WHEEL = wheel-$(WHEEL_VERSION) ZOOKEEPER = zookeeper-$(ZOOKEEPER_VERSION) EXTRA_DIST = \ $(DISTRIBUTE).tar.gz \ $(LEVELDB).tar.gz \ + $(PIP).tar.gz \ + $(WHEEL).tar.gz \ $(ZOOKEEPER).tar.gz # We need to patch leveldb to prevent it from linking to snappy and @@ -50,9 +54,10 @@ EXTRA_DIST += \ CLEAN_EXTRACTED = \ $(DISTRIBUTE) \ $(LEVELDB) \ + $(PIP) \ + $(WHEEL) \ $(ZOOKEEPER) - # This is where the magic happens: we use stamp files as dependencies # which cause the packages to get extracted as necessary. We also # apply any patches as appropriate. @@ -66,13 +71,15 @@ ALL_LOCAL = # Initialize ALL_LOCAL so we can add to it. if HAS_PYTHON if WITH_BUNDLED_DISTRIBUTE - DISTRIBUTE_EGG = \ - $(DISTRIBUTE)/dist/$(DISTRIBUTE)$(PYTHON_EGG_PUREPY_POSTFIX).egg + ALL_LOCAL += $(DISTRIBUTE)-stamp +endif - $(DISTRIBUTE_EGG): $(DISTRIBUTE)-stamp - cd $(DISTRIBUTE) && $(PYTHON) setup.py bdist_egg +if WITH_BUNDLED_PIP + ALL_LOCAL += $(PIP)-stamp +endif - ALL_LOCAL += $(DISTRIBUTE_EGG) +if WITH_BUNDLED_WHEEL + ALL_LOCAL += $(WHEEL)-stamp endif endif http://git-wip-us.apache.org/repos/asf/mesos/blob/9c146e3d/3rdparty/pip-1.5.6.tar.gz ---------------------------------------------------------------------- diff --git a/3rdparty/pip-1.5.6.tar.gz b/3rdparty/pip-1.5.6.tar.gz new file mode 100644 index 0000000..b211135 Binary files /dev/null and b/3rdparty/pip-1.5.6.tar.gz differ http://git-wip-us.apache.org/repos/asf/mesos/blob/9c146e3d/3rdparty/versions.am ---------------------------------------------------------------------- diff --git a/3rdparty/versions.am b/3rdparty/versions.am index cd7c1cf..a3e17df 100644 --- a/3rdparty/versions.am +++ b/3rdparty/versions.am @@ -20,4 +20,6 @@ # still need to update version numbers in src/python/setup.py.in too! DISTRIBUTE_VERSION = 0.6.26 +PIP_VERSION = 1.5.6 +WHEEL_VERSION = 0.24.0 ZOOKEEPER_VERSION = 3.4.5 http://git-wip-us.apache.org/repos/asf/mesos/blob/9c146e3d/3rdparty/wheel-0.24.0.tar.gz ---------------------------------------------------------------------- diff --git a/3rdparty/wheel-0.24.0.tar.gz b/3rdparty/wheel-0.24.0.tar.gz new file mode 100644 index 0000000..f006dd3 Binary files /dev/null and b/3rdparty/wheel-0.24.0.tar.gz differ http://git-wip-us.apache.org/repos/asf/mesos/blob/9c146e3d/Makefile.am ---------------------------------------------------------------------- diff --git a/Makefile.am b/Makefile.am index dcbe484..dcd0cb4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -38,6 +38,13 @@ all-recursive: src/python/setup.py \ EXTRA_DIST += bootstrap LICENSE NOTICE README.md \ support/atexit.sh support/colors.sh +# On install, pip fetches and installs all missing dependencies. When running +# distcheck, this behavior ends up installing files that we are not able to +# uninstall (protobuf for example). Using this flag during the distcheck run +# forces us to verify that we can install/uninstall the mesos specific +# libraries and only those libraries. +AM_DISTCHECK_CONFIGURE_FLAGS = --disable-python-dependency-install + # MPI framework. EXTRA_DIST += mpi/README mpi/mpiexec-mesos.in mpi/mpiexec-mesos.py http://git-wip-us.apache.org/repos/asf/mesos/blob/9c146e3d/configure.ac ---------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index 36d2083..da1c82d 100644 --- a/configure.ac +++ b/configure.ac @@ -201,6 +201,35 @@ AC_ARG_ENABLE([bundled-distribute], in PYTHONPATH]), [without_bundled_distribute=yes], []) +AC_ARG_ENABLE([bundled-pip], + AS_HELP_STRING([--disable-bundled-pip], + [excludes building and using the bundled pip + package in lieu of an installed version in + in PYTHONPATH]), + [without_bundled_pip=yes], []) + +AC_ARG_ENABLE([bundled-wheel], + AS_HELP_STRING([--disable-bundled-wheel], + [excludes building and using the bundled wheel + package in lieu of an installed version in + in PYTHONPATH]), + [without_bundled_wheel=yes], []) + +# This is used to make distcheck and python install work together. For more +# information, see the comment above AM_DISTCHECK_CONFIGURE_FLAGS in +# Makefile.am. +AC_ARG_ENABLE([python-dependency-install], + AS_HELP_STRING([--disable-python-dependency-install], + [when the python packages are installed during + make install, no external dependencies are + downloaded or installed]), + [without_python_deps=yes], []) + +AC_ARG_WITH([cxx11], + AS_HELP_STRING([--without-cxx11], + [builds Mesos without C++11 support (deprecated)]), + [], [with_cxx11=yes]) + AC_ARG_WITH([network-isolator], AS_HELP_STRING([--with-network-isolator], [builds the network isolator]), @@ -1054,6 +1083,16 @@ There are two possible workarounds for this issue: from distutils.util import get_platform; \ print "-py" + sys.version[[0:3]]'` + PYTHON_WHL_POSTFIX=`$PYTHON -c \ + 'import sys; \ + from distutils.util import get_platform; \ + print "-cp" + sys.version[[0:3]].replace(".", "") + "-none-" \ + + get_platform().replace(".", "_").replace("-", "_")'` + + PYTHON_WHL_PUREPY_POSTFIX=`$PYTHON -c \ + 'import sys; \ + print "-py" + sys.version[[0]] + "-none-any"'` + AC_CONFIG_FILES([src/examples/python/test-executor], [chmod +x src/examples/python/test-executor]) AC_CONFIG_FILES([src/examples/python/test-framework], @@ -1080,6 +1119,8 @@ There are two possible workarounds for this issue: AC_SUBST([PYTHON_CFLAGS]) AC_SUBST([PYTHON_EGG_POSTFIX]) AC_SUBST([PYTHON_EGG_PUREPY_POSTFIX]) + AC_SUBST([PYTHON_WHL_POSTFIX]) + AC_SUBST([PYTHON_WHL_PUREPY_POSTFIX]) AC_SUBST([PYTHON]) # Used by the example shell scripts and src/Makefile.am. AC_DEFINE([MESOS_HAS_PYTHON]) @@ -1125,6 +1166,54 @@ correct if you're already doing this. with_bundled_distribute=yes fi + # Check if user has asked us to use a preinstalled pip, or if + # they asked us to ignore all bundled libraries while compiling and linking. + if test "x$without_bundled_pip" = "xyes" || \ + test "x$enable_bundled" != "xyes"; then + + AC_PYTHON_MODULE([pip], [no]) + if test "x$HAVE_PYMOD_pip" = "xno"; then + AC_MSG_ERROR([cannot find pip +------------------------------------------------------------------- +You have requested the use of a non-bundled pip but no suitable +pip could be found. + +You may want specify the location of pip by providing a prefix +path via --with-pip=DIR, or check that the path you provided is +correct if you're already doing this. +------------------------------------------------------------------- +]) + else + with_bundled_pip=no + fi + else + with_bundled_pip=yes + fi + + # Check if user has asked us to use a preinstalled wheel, or if + # they asked us to ignore all bundled libraries while compiling and linking. + if test "x$without_bundled_wheel" = "xyes" || \ + test "x$enable_bundled" != "xyes"; then + + AC_PYTHON_MODULE([wheel], [no]) + if test "x$HAVE_PYMOD_wheel" = "xno"; then + AC_MSG_ERROR([cannot find wheel +------------------------------------------------------------------- +You have requested the use of a non-bundled wheel but no suitable +wheel could be found. + +You may want specify the location of wheel by providing a prefix +path via --with-wheel=DIR, or check that the path you provided is +correct if you're already doing this. +------------------------------------------------------------------- +]) + else + with_bundled_wheel=no + fi + else + with_bundled_wheel=yes + fi + has_python=yes fi @@ -1132,6 +1221,13 @@ AM_CONDITIONAL([HAS_PYTHON], [test "x$has_python" = "xyes"]) AM_CONDITIONAL([WITH_BUNDLED_DISTRIBUTE], [test "x$with_bundled_distribute" = "xyes"]) +AM_CONDITIONAL([WITH_BUNDLED_PIP], + [test "x$with_bundled_pip" = "xyes"]) +AM_CONDITIONAL([WITH_BUNDLED_WHEEL], + [test "x$with_bundled_wheel" = "xyes"]) + +AM_CONDITIONAL([WITHOUT_PYTHON_DEPS], + [test "x$without_python_deps" = "xyes"]) AM_CONDITIONAL([GIT_REPO], [test -d ${srcdir}"/.git"]) http://git-wip-us.apache.org/repos/asf/mesos/blob/9c146e3d/mpi/mpiexec-mesos.in ---------------------------------------------------------------------- diff --git a/mpi/mpiexec-mesos.in b/mpi/mpiexec-mesos.in index 82a1350..021dd5b 100644 --- a/mpi/mpiexec-mesos.in +++ b/mpi/mpiexec-mesos.in @@ -16,37 +16,18 @@ test ! -z "${PYTHON}" && \ PYTHON=@PYTHON@ -DISTRIBUTE_EGG=`echo ${MESOS_BUILD_DIR}/3rdparty/distribute-*/dist/*.egg` - -test ! -e ${DISTRIBUTE_EGG} && \ - echo "${RED}Failed to find ${DISTRIBUTE_EGG} verify PYTHONPATH${NORMAL}" - -PROTOBUF=${MESOS_BUILD_DIR}/3rdparty/libprocess/3rdparty/protobuf-* -PROTOBUF_EGG=`echo ${PROTOBUF}/python/dist/protobuf*.egg` +DISTRIBUTE=`echo ${MESOS_BUILD_DIR}/3rdparty/distribute-*/` # Just warn in the case when build with --disable-bundled. -test ! -e ${PROTOBUF_EGG} && \ - echo "${RED}Failed to find ${PROTOBUF_EGG} check your PYTHONPATH${NORMAL}" - -MESOS_EGGS="" -for egg in interface native; do - base_dir="${MESOS_BUILD_DIR}/src/python/${egg}/dist/" - egg_path="${base_dir}mesos.${egg}-@PACKAGE_VERSION@" - - if [[ ${egg} == "native" ]]; then - egg_path+="@PYTHON_EGG_POSTFIX@" - else - egg_path+="@PYTHON_EGG_PUREPY_POSTFIX@" - fi +test ! -e ${DISTRIBUTE} && \ + echo "${RED}Failed to find ${DISTRIBUTE}${NORMAL}" - egg_path+=".egg" +PROTOBUF=`echo ${MESOS_BUILD_DIR}/3rdparty/libprocess/3rdparty/protobuf-*/python/` - test ! -e ${egg_path} && \ - echo "${RED}Failed to find ${egg_path}${NORMAL}" && \ - exit 1 +test ! -e ${PROTOBUF} && \ + echo "${RED}Failed to find ${PROTOBUF}${NORMAL}" - MESOS_EGGS+="${egg_path}:" -done +MESOS_EGGS=$(find ${MESOS_BUILD_DIR}/src/python/dist -name "*.egg" | tr "\\n" ":") SCRIPT=${MESOS_SOURCE_DIR}/mpi/mpiexec-mesos.py @@ -54,5 +35,5 @@ test ! -e ${SCRIPT} && \ echo "${RED}Failed to find ${SCRIPT}${NORMAL}" && \ exit 1 -PYTHONPATH="${DISTRIBUTE_EGG}:${PROTOBUF_EGG}:${MESOS_EGGS}" \ +PYTHONPATH="${DISTRIBUTE}:${PROTOBUF}:${MESOS_EGGS}" \ exec ${PYTHON} ${SCRIPT} "${@}" http://git-wip-us.apache.org/repos/asf/mesos/blob/9c146e3d/src/Makefile.am ---------------------------------------------------------------------- diff --git a/src/Makefile.am b/src/Makefile.am index c62a974..cff38ce 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,6 +26,8 @@ include ../3rdparty/libprocess/3rdparty/versions.am # TODO(charles): Move these into an included automakefile and have # them include $(top_builddir) as appropriate. DISTRIBUTE = 3rdparty/distribute-$(DISTRIBUTE_VERSION) +PIP = 3rdparty/pip-$(PIP_VERSION) +WHEEL = 3rdparty/wheel-$(WHEEL_VERSION) LEVELDB = 3rdparty/leveldb ZOOKEEPER = 3rdparty/zookeeper-$(ZOOKEEPER_VERSION)/src/c ZOOKEEPER_JAR = 3rdparty/zookeeper-$(ZOOKEEPER_VERSION)/zookeeper-$(ZOOKEEPER_VERSION).jar @@ -954,10 +956,6 @@ PYTHON_SOURCE = \ EXTRA_DIST += $(PYTHON_SOURCE) if HAS_PYTHON -# Used for building Python eggs. -DISTRIBUTE_EGG_SUFFIX = $(DISTRIBUTE_VERSION)$(PYTHON_EGG_PUREPY_POSTFIX).egg -DISTRIBUTE_EGG = \ - $(abs_top_builddir)/$(DISTRIBUTE)/dist/distribute-$(DISTRIBUTE_EGG_SUFFIX) if WITH_BUNDLED_PROTOBUF # Build a protobuf Python egg. @@ -994,23 +992,75 @@ $(PYTHON_SOURCE): test "$(top_srcdir)" = "$(top_builddir)" || \ ($(MKDIR_P) $(@D) && cp -pf $(srcdir)/$@ $@) +# We currently require both eggs and wheels to be built. Eggs can be added to +# the PYTHONPATH and imported. These end up being used for the tests. Wheels +# can be easily uninstalled. They end up being what gets installed/uninstalled. MESOS_EGGS = \ - python/dist/mesos-$(PACKAGE_VERSION)$(PYTHON_EGG_PUREPY_POSTFIX).egg \ - python/interface/dist/mesos.interface-$(PACKAGE_VERSION)$(PYTHON_EGG_PUREPY_POSTFIX).egg \ - python/native/dist/mesos.native-$(PACKAGE_VERSION)$(PYTHON_EGG_POSTFIX).egg - -$(MESOS_EGGS): \ - $(PYTHON_PROTOS) \ - $(PYTHON_SOURCE) \ - libmesos_no_3rdparty.la \ + python/dist/mesos.interface-$(PACKAGE_VERSION)$(PYTHON_EGG_PUREPY_POSTFIX).egg \ + python/dist/mesos.native-$(PACKAGE_VERSION)$(PYTHON_EGG_POSTFIX).egg + +MESOS_WHLS = \ + python/dist/mesos.interface-$(PACKAGE_VERSION)$(PYTHON_WHL_PUREPY_POSTFIX).whl \ + python/dist/mesos.native-$(PACKAGE_VERSION)$(PYTHON_WHL_POSTFIX).whl + +# The python source is in directories of the form: python/interface. The make +# target is of the form: python/dist/mesos.interface-0.20.0-py2.7.egg. To build +# this, we must first cd into it. The first line of this takes the make target +# and converts it into the correct directory path. +$(MESOS_EGGS) $(MESOS_WHLS): \ + $(PYTHON_PROTOS) \ + $(PYTHON_SOURCE) \ + libmesos_no_3rdparty.la \ $(PROTOBUF_EGG) - @cd `echo $@ | awk -F"dist" '{print $$1}'` && \ - LIBS="$(LIBS)" CC="$(CC)" CXX="$(CXX)" \ - CFLAGS="$(PYTHON_CFLAGS)" CPPFLAGS="$(PYTHON_CPPFLAGS)" \ - LDFLAGS="$(PYTHON_LDFLAGS)" \ - PYTHONPATH=$(DISTRIBUTE_EGG) $(PYTHON) setup.py bdist_egg + @cd python/`echo $@ | awk -F"mesos[.]?" '{print $$2}' | cut -d- -f1` && \ + LIBS="$(LIBS)" CC="$(CC)" CXX="$(CXX)" \ + CFLAGS="$(PYTHON_CFLAGS)" CPPFLAGS="$(PYTHON_CPPFLAGS)" \ + LDFLAGS="$(PYTHON_LDFLAGS)" \ + PYTHONPATH=$(abs_top_builddir)/$(DISTRIBUTE):$(abs_top_builddir)/$(WHEEL) \ + $(PYTHON) setup.py bdist_egg --dist-dir=../dist \ + bdist_wheel --dist-dir=../dist -CLEANFILES += $(MESOS_EGGS) python/*/build python/*/dist $(PYTHON_SOURCE) +CLEANFILES += $(MESOS_EGGS) $(MESOS_WHLS) python/*/build python/*/dist $(PYTHON_SOURCE) + +pippythonpath=$(DESTDIR)$(pythondir):$(abs_top_builddir)/$(DISTRIBUTE):$(abs_top_builddir)/$(PIP):$(abs_top_builddir)/$(WHEEL) + +# Some python installations create their own distutils.cfg (homebrew, redhat). +# This includes `prefix=` which overrides anything set via. pip during install. +# The file is required to ensure the python packages get installed to the right +# location. It only affects files installed from the python/dist directory. +python/dist/setup.cfg: + printf "[install]\nprefix=\n" > $@ + +# See the comment next to AM_DISTCHECK_CONFIGURE_FLAGS in the top level +# Makefile.am for an explanation of this variable. +pipinstallargs= + +if WITHOUT_PYTHON_DEPS + + pipinstallargs += --no-deps + +endif + +# We are using the 3rdparty bundled pip instead of relying on what might exist +# on the system. Because the actual pip scripts have not been created, we just +# use the standard entry point. +install-exec-local: + cd python/dist && \ + for whl in $(MESOS_WHLS); do \ + PYTHONPATH=$(pippythonpath) \ + PYTHONUSERBASE=$(DESTDIR)$(prefix) \ + $(PYTHON) -c "import pip; pip.main()" install \ + --user $(pipinstallargs) \ + --find-links=file://$(abs_top_builddir)/src/python/dist \ + $(abs_top_builddir)/src/$$whl; \ + done + +uninstall-local: + for whl in $(MESOS_WHLS); do \ + PYTHONPATH=$(DESTDIR)$(pythondir):$(pippythonpath) \ + $(PYTHON) -c "import pip; pip.main()" uninstall \ + --yes $$(echo $$whl | cut -d/ -f3 | cut -d- -f1); \ + done # Make sure the egg gets built via 'make all'. all-local: $(MESOS_EGGS) http://git-wip-us.apache.org/repos/asf/mesos/blob/9c146e3d/src/examples/python/test-containerizer.in ---------------------------------------------------------------------- diff --git a/src/examples/python/test-containerizer.in b/src/examples/python/test-containerizer.in index c82f3dc..b8258e7 100644 --- a/src/examples/python/test-containerizer.in +++ b/src/examples/python/test-containerizer.in @@ -14,39 +14,18 @@ test ! -z "${PYTHON}" && \ PYTHON=@PYTHON@ -DISTRIBUTE_EGG=${MESOS_BUILD_DIR}/3rdparty/distribute-0.6.26/dist/ -DISTRIBUTE_EGG+=distribute-0.6.26@[email protected] +DISTRIBUTE=`echo ${MESOS_BUILD_DIR}/3rdparty/distribute-*/` -test ! -e ${DISTRIBUTE_EGG} && \ - echo "${RED}Failed to find ${DISTRIBUTE_EGG} verify PYTHONPATH${NORMAL}" +# Just warn in the case when build with --disable-bundled. +test ! -e ${DISTRIBUTE} && \ + echo "${RED}Failed to find ${DISTRIBUTE}${NORMAL}" -PROTOBUF=${MESOS_BUILD_DIR}/3rdparty/libprocess/3rdparty/protobuf-2.5.0 +PROTOBUF=`echo ${MESOS_BUILD_DIR}/3rdparty/libprocess/3rdparty/protobuf-*/python/` -PROTOBUF_EGG=${PROTOBUF}/python/dist/ -PROTOBUF_EGG+=protobuf-2.5.0@[email protected] +test ! -e ${PROTOBUF} && \ + echo "${RED}Failed to find ${PROTOBUF}${NORMAL}" -test ! -e ${PROTOBUF_EGG} && \ - echo "${RED}Failed to find ${PROTOBUF_EGG} check your PYTHONPATH${NORMAL}" - -MESOS_EGGS="" -for egg in interface native; do - base_dir="${MESOS_BUILD_DIR}/src/python/${egg}/dist/" - egg_path="${base_dir}mesos.${egg}-@PACKAGE_VERSION@" - - if [[ ${egg} == "native" ]]; then - egg_path+="@PYTHON_EGG_POSTFIX@" - else - egg_path+="@PYTHON_EGG_PUREPY_POSTFIX@" - fi - - egg_path+=".egg" - - test ! -e ${egg_path} && \ - echo "${RED}Failed to find ${egg_path}${NORMAL}" && \ - exit 1 - - MESOS_EGGS+="${egg_path}:" -done +MESOS_EGGS=$(find ${MESOS_BUILD_DIR}/src/python/dist -name "*.egg" | tr "\\n" ":") SCRIPT=${MESOS_SOURCE_DIR}/src/examples/python/test_containerizer.py @@ -54,5 +33,5 @@ test ! -e ${SCRIPT} && \ echo "${RED}Failed to find ${SCRIPT}${NORMAL}" && \ exit 1 -PYTHONPATH="${DISTRIBUTE_EGG}:${PROTOBUF_EGG}:${MESOS_EGGS}" \ +PYTHONPATH="${DISTRIBUTE}:${PROTOBUF}:${MESOS_EGGS}" \ exec ${PYTHON} ${SCRIPT} "${@}" http://git-wip-us.apache.org/repos/asf/mesos/blob/9c146e3d/src/examples/python/test-executor.in ---------------------------------------------------------------------- diff --git a/src/examples/python/test-executor.in b/src/examples/python/test-executor.in index 0725568..6be0ad2 100644 --- a/src/examples/python/test-executor.in +++ b/src/examples/python/test-executor.in @@ -14,39 +14,18 @@ test ! -z "${PYTHON}" && \ PYTHON=@PYTHON@ -DISTRIBUTE_EGG=${MESOS_BUILD_DIR}/3rdparty/distribute-0.6.26/dist/ -DISTRIBUTE_EGG+=distribute-0.6.26@[email protected] +DISTRIBUTE=`echo ${MESOS_BUILD_DIR}/3rdparty/distribute-*/` -test ! -e ${DISTRIBUTE_EGG} && \ - echo "${RED}Failed to find ${DISTRIBUTE_EGG} verify PYTHONPATH${NORMAL}" +# Just warn in the case when build with --disable-bundled. +test ! -e ${DISTRIBUTE} && \ + echo "${RED}Failed to find ${DISTRIBUTE}${NORMAL}" -PROTOBUF=${MESOS_BUILD_DIR}/3rdparty/libprocess/3rdparty/protobuf-2.5.0 +PROTOBUF=`echo ${MESOS_BUILD_DIR}/3rdparty/libprocess/3rdparty/protobuf-*/python/` -PROTOBUF_EGG=${PROTOBUF}/python/dist/ -PROTOBUF_EGG+=protobuf-2.5.0@[email protected] +test ! -e ${PROTOBUF} && \ + echo "${RED}Failed to find ${PROTOBUF}${NORMAL}" -test ! -e ${PROTOBUF_EGG} && \ - echo "${RED}Failed to find ${PROTOBUF_EGG} check your PYTHONPATH${NORMAL}" - -MESOS_EGGS="" -for egg in interface native; do - base_dir="${MESOS_BUILD_DIR}/src/python/${egg}/dist/" - egg_path="${base_dir}mesos.${egg}-@PACKAGE_VERSION@" - - if [[ ${egg} == "native" ]]; then - egg_path+="@PYTHON_EGG_POSTFIX@" - else - egg_path+="@PYTHON_EGG_PUREPY_POSTFIX@" - fi - - egg_path+=".egg" - - test ! -e ${egg_path} && \ - echo "${RED}Failed to find ${egg_path}${NORMAL}" && \ - exit 1 - - MESOS_EGGS+="${egg_path}:" -done +MESOS_EGGS=$(find ${MESOS_BUILD_DIR}/src/python/dist -name "*.egg" | tr "\\n" ":") SCRIPT=${MESOS_SOURCE_DIR}/src/examples/python/test_executor.py @@ -54,5 +33,5 @@ test ! -e ${SCRIPT} && \ echo "${RED}Failed to find ${SCRIPT}${NORMAL}" && \ exit 1 -PYTHONPATH="${DISTRIBUTE_EGG}:${PROTOBUF_EGG}:${MESOS_EGGS}" \ +PYTHONPATH="${DISTRIBUTE}:${PROTOBUF}:${MESOS_EGGS}" \ exec ${PYTHON} ${SCRIPT} "${@}" http://git-wip-us.apache.org/repos/asf/mesos/blob/9c146e3d/src/examples/python/test-framework.in ---------------------------------------------------------------------- diff --git a/src/examples/python/test-framework.in b/src/examples/python/test-framework.in index 1a43002..59bab82 100644 --- a/src/examples/python/test-framework.in +++ b/src/examples/python/test-framework.in @@ -14,39 +14,18 @@ test ! -z "${PYTHON}" && \ PYTHON=@PYTHON@ -DISTRIBUTE_EGG=${MESOS_BUILD_DIR}/3rdparty/distribute-0.6.26/dist/ -DISTRIBUTE_EGG+=distribute-0.6.26@[email protected] +DISTRIBUTE=`echo ${MESOS_BUILD_DIR}/3rdparty/distribute-*/` -test ! -e ${DISTRIBUTE_EGG} && \ - echo "${RED}Failed to find ${DISTRIBUTE_EGG} verify PYTHONPATH${NORMAL}" +# Just warn in the case when build with --disable-bundled. +test ! -e ${DISTRIBUTE} && \ + echo "${RED}Failed to find ${DISTRIBUTE}${NORMAL}" -PROTOBUF=${MESOS_BUILD_DIR}/3rdparty/libprocess/3rdparty/protobuf-2.5.0 +PROTOBUF=`echo ${MESOS_BUILD_DIR}/3rdparty/libprocess/3rdparty/protobuf-*/python/` -PROTOBUF_EGG=${PROTOBUF}/python/dist/ -PROTOBUF_EGG+=protobuf-2.5.0@[email protected] +test ! -e ${PROTOBUF} && \ + echo "${RED}Failed to find ${PROTOBUF}${NORMAL}" -test ! -e ${PROTOBUF_EGG} && \ - echo "${RED}Failed to find ${PROTOBUF_EGG} check your PYTHONPATH ${NORMAL}" - -MESOS_EGGS="" -for egg in interface native; do - base_dir="${MESOS_BUILD_DIR}/src/python/${egg}/dist/" - egg_path="${base_dir}mesos.${egg}-@PACKAGE_VERSION@" - - if [[ ${egg} == "native" ]]; then - egg_path+="@PYTHON_EGG_POSTFIX@" - else - egg_path+="@PYTHON_EGG_PUREPY_POSTFIX@" - fi - - egg_path+=".egg" - - test ! -e ${egg_path} && \ - echo "${RED}Failed to find ${egg_path}${NORMAL}" && \ - exit 1 - - MESOS_EGGS+="${egg_path}:" -done +MESOS_EGGS=$(find ${MESOS_BUILD_DIR}/src/python/dist -name "*.egg" | tr "\\n" ":") SCRIPT=${MESOS_SOURCE_DIR}/src/examples/python/test_framework.py @@ -58,5 +37,5 @@ test ! -e ${SCRIPT} && \ # framework is able to find the executor. cd `dirname ${0}` -PYTHONPATH="${DISTRIBUTE_EGG}:${PROTOBUF_EGG}:${MESOS_EGGS}" \ +PYTHONPATH="${DISTRIBUTE}:${PROTOBUF}:${MESOS_EGGS}" \ exec ${PYTHON} ${SCRIPT} "${@}"
