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
| ... | ... |
@@ -647,6 +647,16 @@ function get_packages() {
|
| 647 | 647 |
done |
| 648 | 648 |
} |
| 649 | 649 |
|
| 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 |
+ |
|
| 650 | 660 |
# install package requirements |
| 651 | 661 |
if [[ "$os_PACKAGE" = "deb" ]]; then |
| 652 | 662 |
apt_get update |
| ... | ... |
@@ -710,38 +720,38 @@ fi |
| 710 | 710 |
|
| 711 | 711 |
# setup our checkouts so they are installed into python path |
| 712 | 712 |
# 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 |
|
| 713 |
+cd $KEYSTONECLIENT_DIR; setup_develop |
|
| 714 |
+cd $NOVACLIENT_DIR; setup_develop |
|
| 715 |
+cd $OPENSTACKCLIENT_DIR; setup_develop |
|
| 716 | 716 |
if is_service_enabled key g-api n-api swift; then |
| 717 |
- cd $KEYSTONE_DIR; sudo python setup.py develop |
|
| 717 |
+ cd $KEYSTONE_DIR; setup_develop |
|
| 718 | 718 |
fi |
| 719 | 719 |
if is_service_enabled swift; then |
| 720 |
- cd $SWIFT_DIR; sudo python setup.py develop |
|
| 721 |
- cd $SWIFT3_DIR; sudo python setup.py develop |
|
| 720 |
+ cd $SWIFT_DIR; setup_develop |
|
| 721 |
+ cd $SWIFT3_DIR; setup_develop |
|
| 722 | 722 |
fi |
| 723 | 723 |
if is_service_enabled g-api n-api; then |
| 724 |
- cd $GLANCE_DIR; sudo python setup.py develop |
|
| 724 |
+ cd $GLANCE_DIR; setup_develop |
|
| 725 | 725 |
fi |
| 726 |
-cd $NOVA_DIR; sudo python setup.py develop |
|
| 726 |
+cd $NOVA_DIR; setup_develop |
|
| 727 | 727 |
if is_service_enabled horizon; then |
| 728 |
- cd $HORIZON_DIR; sudo python setup.py develop |
|
| 728 |
+ cd $HORIZON_DIR; setup_develop |
|
| 729 | 729 |
fi |
| 730 | 730 |
if is_service_enabled quantum; then |
| 731 |
- cd $QUANTUM_CLIENT_DIR; sudo python setup.py develop |
|
| 731 |
+ cd $QUANTUM_CLIENT_DIR; setup_develop |
|
| 732 | 732 |
fi |
| 733 | 733 |
if is_service_enabled quantum; then |
| 734 |
- cd $QUANTUM_DIR; sudo python setup.py develop |
|
| 734 |
+ cd $QUANTUM_DIR; setup_develop |
|
| 735 | 735 |
fi |
| 736 | 736 |
if is_service_enabled m-svc; then |
| 737 |
- cd $MELANGE_DIR; sudo python setup.py develop |
|
| 737 |
+ cd $MELANGE_DIR; setup_develop |
|
| 738 | 738 |
fi |
| 739 | 739 |
if is_service_enabled melange; then |
| 740 |
- cd $MELANGECLIENT_DIR; sudo python setup.py develop |
|
| 740 |
+ cd $MELANGECLIENT_DIR; setup_develop |
|
| 741 | 741 |
fi |
| 742 | 742 |
|
| 743 | 743 |
# Do this _after_ glance is installed to override the old binary |
| 744 |
-cd $GLANCECLIENT_DIR; sudo python setup.py develop |
|
| 744 |
+cd $GLANCECLIENT_DIR; setup_develop |
|
| 745 | 745 |
|
| 746 | 746 |
|
| 747 | 747 |
# Syslog |