diff --git a/functions-common b/functions-common index a13d611415..6be07b42bb 100644 --- a/functions-common +++ b/functions-common @@ -27,7 +27,6 @@ # - ``RECLONE`` # - ``REQUIREMENTS_DIR`` # - ``STACK_USER`` -# - ``TRACK_DEPENDS`` # - ``http_proxy``, ``https_proxy``, ``no_proxy`` # @@ -44,7 +43,6 @@ declare -A -g GITREPO declare -A -g GITBRANCH declare -A -g GITDIR -TRACK_DEPENDS=${TRACK_DEPENDS:-False} KILL_PATH="$(which kill)" # Save these variables to .stackenv @@ -2075,11 +2073,7 @@ function _safe_permission_operation { return 0 fi - if [[ $TRACK_DEPENDS = True ]]; then - sudo_cmd="env" - else - sudo_cmd="sudo" - fi + sudo_cmd="sudo" $xtrace $sudo_cmd $@ diff --git a/inc/python b/inc/python index 81b6a960a4..fd43cef932 100644 --- a/inc/python +++ b/inc/python @@ -175,7 +175,7 @@ function disable_python3_package { # Wrapper for ``pip install`` to set cache and proxy environment variables # Uses globals ``OFFLINE``, ``PIP_VIRTUAL_ENV``, -# ``PIP_UPGRADE``, ``TRACK_DEPENDS``, ``*_proxy``, +# ``PIP_UPGRADE``, ``*_proxy``, # Usage: # pip_install pip_arguments function pip_install { @@ -219,37 +219,28 @@ function pip_install { # this works (for now...) local package_dir=${!#%\[*\]} - if [[ $TRACK_DEPENDS = True && ! "$@" =~ virtualenv ]]; then - # TRACK_DEPENDS=True installation creates a circular dependency when - # we attempt to install virtualenv into a virtualenv, so we must global - # that installation. - source $DEST/.venv/bin/activate - local cmd_pip=$DEST/.venv/bin/pip + if [[ -n ${PIP_VIRTUAL_ENV:=} && -d ${PIP_VIRTUAL_ENV} ]]; then + local cmd_pip=$PIP_VIRTUAL_ENV/bin/pip local sudo_pip="env" else - if [[ -n ${PIP_VIRTUAL_ENV:=} && -d ${PIP_VIRTUAL_ENV} ]]; then - local cmd_pip=$PIP_VIRTUAL_ENV/bin/pip - local sudo_pip="env" - else - local cmd_pip - cmd_pip=$(get_pip_command $PYTHON2_VERSION) - local sudo_pip="sudo -H" - if python3_enabled; then - # Special case some services that have experimental - # support for python3 in progress, but don't claim support - # in their classifier - echo "Check python version for : $package_dir" - if python3_disabled_for ${package_dir##*/}; then - echo "Explicitly using $PYTHON2_VERSION version to install $package_dir based on DISABLED_PYTHON3_PACKAGES" - else - # For everything that is not explicitly blacklisted with - # DISABLED_PYTHON3_PACKAGES, assume it supports python3 - # and we will let pip sort out the install, regardless of - # the package being local or remote. - echo "Using $PYTHON3_VERSION version to install $package_dir based on default behavior" - sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8" - cmd_pip=$(get_pip_command $PYTHON3_VERSION) - fi + local cmd_pip + cmd_pip=$(get_pip_command $PYTHON2_VERSION) + local sudo_pip="sudo -H" + if python3_enabled; then + # Special case some services that have experimental + # support for python3 in progress, but don't claim support + # in their classifier + echo "Check python version for : $package_dir" + if python3_disabled_for ${package_dir##*/}; then + echo "Explicitly using $PYTHON2_VERSION version to install $package_dir based on DISABLED_PYTHON3_PACKAGES" + else + # For everything that is not explicitly blacklisted with + # DISABLED_PYTHON3_PACKAGES, assume it supports python3 + # and we will let pip sort out the install, regardless of + # the package being local or remote. + echo "Using $PYTHON3_VERSION version to install $package_dir based on default behavior" + sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8" + cmd_pip=$(get_pip_command $PYTHON3_VERSION) fi fi fi diff --git a/stack.sh b/stack.sh index d0206ebac0..089510fa48 100755 --- a/stack.sh +++ b/stack.sh @@ -796,19 +796,6 @@ if [[ "$OFFLINE" != "True" ]]; then PYPI_ALTERNATIVE_URL=${PYPI_ALTERNATIVE_URL:-""} $TOP_DIR/tools/install_pip.sh fi -TRACK_DEPENDS=${TRACK_DEPENDS:-False} - -# Install Python packages into a virtualenv so that we can track them -if [[ $TRACK_DEPENDS = True ]]; then - echo_summary "Installing Python packages into a virtualenv $DEST/.venv" - pip_install -U virtualenv - - rm -rf $DEST/.venv - virtualenv --system-site-packages $DEST/.venv - source $DEST/.venv/bin/activate - $DEST/.venv/bin/pip freeze > $DEST/requires-pre-pip -fi - # Do the ugly hacks for broken packages and distros source $TOP_DIR/tools/fixup_stuff.sh fixup_all @@ -997,17 +984,6 @@ fi # osc commands. Alias dies with stack.sh. install_oscwrap -if [[ $TRACK_DEPENDS = True ]]; then - $DEST/.venv/bin/pip freeze > $DEST/requires-post-pip - if ! diff -Nru $DEST/requires-pre-pip $DEST/requires-post-pip > $DEST/requires.diff; then - echo "Detect some changes for installed packages of pip, in depend tracking mode" - cat $DEST/requires.diff - fi - echo "Ran stack.sh in depend tracking mode, bailing out now" - exit 0 -fi - - # Syslog # ------