Browse code

Update projects to global requirements before setup

We've agreed that we should be using global requirements, so
force projects to be updated to global requirements before we
test them.

Co-Authored-With: Monty Taylor <mordred@inaugust.com>

Change-Id: I0652f639673e600fd7508a9869ec85f8d5ce4518

Sean Dague authored on 2013/07/31 19:50:14
Showing 2 changed files
... ...
@@ -1131,18 +1131,32 @@ function service_check() {
1131 1131
 # Uses globals ``STACK_USER``, ``TRACK_DEPENDES``, ``*_proxy`
1132 1132
 # setup_develop directory
1133 1133
 function setup_develop() {
1134
+    local project_dir=$1
1134 1135
     if [[ $TRACK_DEPENDS = True ]]; then
1135 1136
         SUDO_CMD="env"
1136 1137
     else
1137 1138
         SUDO_CMD="sudo"
1138 1139
     fi
1139
-    $SUDO_CMD \
1140
-        HTTP_PROXY=$http_proxy \
1141
-        HTTPS_PROXY=$https_proxy \
1142
-        NO_PROXY=$no_proxy \
1143
-        pip install -e $1
1144
-    # ensure that further actions can do things like setup.py sdist
1145
-    $SUDO_CMD chown -R $STACK_USER $1/*.egg-info
1140
+
1141
+    echo "cd $REQUIREMENTS_DIR; $SUDO_CMD python update.py $project_dir"
1142
+
1143
+    (cd $REQUIREMENTS_DIR; \
1144
+        $SUDO_CMD python update.py $project_dir)
1145
+
1146
+    for reqs_file in $project_dir/requirements.txt $project_dir/tools/pip-requires ; do
1147
+        if [ -f $reqs_file ] ; then
1148
+            pip_install -r $reqs_file
1149
+        fi
1150
+    done
1151
+
1152
+    (cd $project_dir; \
1153
+        python setup.py egg_info; \
1154
+        $SUDO_CMD \
1155
+            HTTP_PROXY=$http_proxy \
1156
+            HTTPS_PROXY=$https_proxy \
1157
+            NO_PROXY=$no_proxy \
1158
+            python setup.py develop \
1159
+    )
1146 1160
 }
1147 1161
 
1148 1162
 
... ...
@@ -647,7 +647,7 @@ TRACK_DEPENDS=${TRACK_DEPENDS:-False}
647 647
 # Install python packages into a virtualenv so that we can track them
648 648
 if [[ $TRACK_DEPENDS = True ]]; then
649 649
     echo_summary "Installing Python packages into a virtualenv $DEST/.venv"
650
-    install_package python-virtualenv
650
+    pip_install -U virtualenv
651 651
 
652 652
     rm -rf $DEST/.venv
653 653
     virtualenv --system-site-packages $DEST/.venv