Browse code

Install things in setup_develop with pip -e

We have some complex logic in here to try to do the right things with
the requirements before doing the install of the package which still
winds up being wrong in some cases. Since having written this code,
we've learned that the logic we're trying to achieve is actually what
pip install -e does. So just use that. We have to follow up with a chown
of the resulting egg-info directory, because the sudo command will cause
it to be written by root, which prevents subsequent commands from
operating without privilege in the directory.
Change-Id: Iffd068c94ef84475ebb30758bcf612075d225bea

Monty Taylor authored on 2013/08/03 04:43:47
Showing 1 changed files
... ...
@@ -1126,9 +1126,9 @@ function service_check() {
1126 1126
 }
1127 1127
 
1128 1128
 
1129
-# ``pip install`` the dependencies of the package before ``setup.py develop``
1130
-# so pip and not distutils processes the dependency chain
1131
-# Uses globals ``TRACK_DEPENDES``, ``*_proxy`
1129
+# ``pip install -e`` the package, which processes the dependencies
1130
+# using pip before running `setup.py develop`
1131
+# Uses globals ``STACK_USER``, ``TRACK_DEPENDES``, ``*_proxy`
1132 1132
 # setup_develop directory
1133 1133
 function setup_develop() {
1134 1134
     if [[ $TRACK_DEPENDS = True ]]; then
... ...
@@ -1136,19 +1136,13 @@ function setup_develop() {
1136 1136
     else
1137 1137
         SUDO_CMD="sudo"
1138 1138
     fi
1139
-    for reqs_file in $1/requirements.txt $1/tools/pip-requires ; do
1140
-        if [ -f $reqs_file ] ; then
1141
-            pip_install -r $reqs_file
1142
-        fi
1143
-    done
1144
-    (cd $1; \
1145
-        python setup.py egg_info; \
1146
-        $SUDO_CMD \
1147
-            HTTP_PROXY=$http_proxy \
1148
-            HTTPS_PROXY=$https_proxy \
1149
-            NO_PROXY=$no_proxy \
1150
-            python setup.py develop \
1151
-    )
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
1152 1146
 }
1153 1147
 
1154 1148