Skip to content

Commit 66c70c7

Browse files
committed
Use pip to install python depends.
When we use python setup.py develop, if there is a packages not installed already, it means distutils/easy_install installs it. Unfortunately, those are both way more stupid than pip. Instead, get pip to install missing depends, then run the setup.py develop so that distutils doesn't need to install things. Change-Id: Ifad3bbc8e9eac0b14dc5bb40175cf2bd45b64b00
1 parent e959dbc commit 66c70c7

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

stack.sh

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,16 @@ function get_packages() {
647647
done
648648
}
649649

650+
# pip install the dependencies of the package before we do the setup.py
651+
# develop, so that pip and not distutils process the dependency chain
652+
function setup_develop() {
653+
python setup.py egg_info
654+
raw_links=`cat *.egg-info/dependency_links.txt | awk '{print "-f " $1}'`
655+
depend_links=`echo $raw_links | xargs`
656+
sudo pip install -r *-info/requires.txt $depend_links
657+
sudo python setup.py develop
658+
}
659+
650660
# install package requirements
651661
if [[ "$os_PACKAGE" = "deb" ]]; then
652662
apt_get update
@@ -710,38 +720,38 @@ fi
710720

711721
# setup our checkouts so they are installed into python path
712722
# allowing ``import nova`` or ``import glance.client``
713-
cd $KEYSTONECLIENT_DIR; sudo python setup.py develop
714-
cd $NOVACLIENT_DIR; sudo python setup.py develop
715-
cd $OPENSTACKCLIENT_DIR; sudo python setup.py develop
723+
cd $KEYSTONECLIENT_DIR; setup_develop
724+
cd $NOVACLIENT_DIR; setup_develop
725+
cd $OPENSTACKCLIENT_DIR; setup_develop
716726
if is_service_enabled key g-api n-api swift; then
717-
cd $KEYSTONE_DIR; sudo python setup.py develop
727+
cd $KEYSTONE_DIR; setup_develop
718728
fi
719729
if is_service_enabled swift; then
720-
cd $SWIFT_DIR; sudo python setup.py develop
721-
cd $SWIFT3_DIR; sudo python setup.py develop
730+
cd $SWIFT_DIR; setup_develop
731+
cd $SWIFT3_DIR; setup_develop
722732
fi
723733
if is_service_enabled g-api n-api; then
724-
cd $GLANCE_DIR; sudo python setup.py develop
734+
cd $GLANCE_DIR; setup_develop
725735
fi
726-
cd $NOVA_DIR; sudo python setup.py develop
736+
cd $NOVA_DIR; setup_develop
727737
if is_service_enabled horizon; then
728-
cd $HORIZON_DIR; sudo python setup.py develop
738+
cd $HORIZON_DIR; setup_develop
729739
fi
730740
if is_service_enabled quantum; then
731-
cd $QUANTUM_CLIENT_DIR; sudo python setup.py develop
741+
cd $QUANTUM_CLIENT_DIR; setup_develop
732742
fi
733743
if is_service_enabled quantum; then
734-
cd $QUANTUM_DIR; sudo python setup.py develop
744+
cd $QUANTUM_DIR; setup_develop
735745
fi
736746
if is_service_enabled m-svc; then
737-
cd $MELANGE_DIR; sudo python setup.py develop
747+
cd $MELANGE_DIR; setup_develop
738748
fi
739749
if is_service_enabled melange; then
740-
cd $MELANGECLIENT_DIR; sudo python setup.py develop
750+
cd $MELANGECLIENT_DIR; setup_develop
741751
fi
742752

743753
# Do this _after_ glance is installed to override the old binary
744-
cd $GLANCECLIENT_DIR; sudo python setup.py develop
754+
cd $GLANCECLIENT_DIR; setup_develop
745755

746756

747757
# Syslog

0 commit comments

Comments
 (0)