~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to third_party/bash/40python_extras.bash

  • Committer: Chris Rogers
  • Date: 2014-04-16 11:48:45 UTC
  • mfrom: (707 merge)
  • mto: This revision was merged to the branch mainline in revision 711.
  • Revision ID: chris.rogers@stfc.ac.uk-20140416114845-h3u3q7pdcxkxvovs
Update to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 logilab-common logilab-astng suds validictory nose==1.1 nose-exclude  \
21
21
 coverage ipython doxypy pylint==0.25.1 bitarray celery==2.5.5 \
22
22
 pymongo==2.3 readline matplotlib==1.1.0 scons==2.2.0\
23
 
 pil django magickwand
 
23
 pil django==1.5.1 magickwand
24
24
"
 
25
# scons v2.2.0 is no longer on pypi
 
26
# temporary hack to specify the download url for scons==2.2.0
 
27
# pending upgrade to 2.3.0
 
28
# DR March 13, 2014
 
29
scons_version="2.2.0"
 
30
scons_url="http://sourceforge.net/projects/scons/files/scons/${scons_version}/scons-${scons_version}.tar.gz"
 
31
 
25
32
# these are the packages to install - note the version dependencies
26
33
package_list="\
27
34
 anyjson python-dateutil amqplib kombu \
36
43
 pylint bitarray matplotlib celery pymongo \
37
44
 Image django magickwand" #Image is pil bottom level
38
45
binary_test_list="scons"
39
 
 
40
46
cleanup="0"
41
47
get_packages="0"
42
48
install_packages="0"
75
81
    cd $egg_source
76
82
    for package in $download_package_list
77
83
    do
78
 
        easy_install -zmaxeb . $package
 
84
        # tmp hack for scons 2.2.0 which has disappeared from pypi
 
85
        if [[ $package =~ .*scons*. ]]
 
86
        then
 
87
            easy_install -zmaxeb . -f$scons_url $package
 
88
        else
 
89
            echo "easy_install -zmaxeb . $package"
 
90
            easy_install -zmaxeb . $package &
 
91
            # kill the command after <timeout> seconds
 
92
            ((timeout = 120))
 
93
            while ((timeout > 0)); do
 
94
                sleep 1
 
95
                kill -0 $! >& /dev/null
 
96
                if [ "$?" == "0" ]; then # pid is running (can be killed)
 
97
                    ((timeout -= 1))
 
98
                else # pid is finished (can't be killed)
 
99
                    ((timeout = 0))
 
100
                fi
 
101
            done
 
102
            kill -0 $! >& /dev/null
 
103
            if [ "$?" == "0" ]; then # pid is running (can be killed)
 
104
                echo "easy_install of $package has timed out - killing"
 
105
                kill -9 $!
 
106
            fi
 
107
        fi
79
108
    done
80
109
    downloaded_list=`ls --hide=*.tar.gz`
81
110
    echo "INFO: Downloaded the following packages"
90
119
        else
91
120
            echo "INFO:       $item skipped"
92
121
        fi
 
122
        echo ">>>>>removing $item"
93
123
        rm -rf $item # cleanup anything not tarred
94
124
    done
95
125
fi