Browse code

Actually install the requirements repo.

The requirements repo has had a setup.cfg etc for a long time but only
recently started using it. As it now has dependencies, we need to pip
install it. To preserve compat with older requirements repos I haven't
changed the call to invoke update-requirements yet, as we still have
the update.py symlink.

This is a backport of the final code from master.

Change-Id: I7d7e91694c9145fac0ddab8a9de5f789d723c641

Robert Collins authored on 2015/06/19 05:04:00
Showing 2 changed files
... ...
@@ -1666,7 +1666,7 @@ function setup_package_with_req_sync {
1666 1666
 
1667 1667
     if [[ $update_requirements != "changed" ]]; then
1668 1668
         (cd $REQUIREMENTS_DIR; \
1669
-            python update.py $project_dir)
1669
+            ./.venv/bin/python update.py $project_dir)
1670 1670
     fi
1671 1671
 
1672 1672
     setup_package $project_dir $flags
... ...
@@ -27,8 +27,17 @@ REQUIREMENTS_DIR=$DEST/requirements
27 27
 
28 28
 # install_infra() - Collect source and prepare
29 29
 function install_infra {
30
+    local PIP_VIRTUAL_ENV="$REQUIREMENTS_DIR/.venv"
30 31
     # bring down global requirements
31 32
     git_clone $REQUIREMENTS_REPO $REQUIREMENTS_DIR $REQUIREMENTS_BRANCH
33
+    [ ! -d $PIP_VIRTUAL_ENV ] && virtualenv $PIP_VIRTUAL_ENV
34
+    # We don't care about testing git pbr in the requirements venv.
35
+    PIP_VIRTUAL_ENV=$PIP_VIRTUAL_ENV pip_install -U pbr
36
+    PIP_VIRTUAL_ENV=$PIP_VIRTUAL_ENV pip_install $REQUIREMENTS_DIR
37
+
38
+    # Unset the PIP_VIRTUAL_ENV so that PBR does not end up trapped
39
+    # down the VENV well
40
+    unset PIP_VIRTUAL_ENV
32 41
 
33 42
     # Install pbr
34 43
     if use_library_from_git "pbr"; then