|
2 | 2 | faciltate testing.""" |
3 | 3 | import shutil, os, sys |
4 | 4 | from subprocess import Popen, PIPE, STDOUT |
| 5 | +from optparse import OptionParser |
5 | 6 |
|
6 | 7 | from _buildbot_util import check_call |
7 | 8 |
|
| 9 | +usage = """%prog [options]""" |
| 10 | +parser = OptionParser(usage) |
| 11 | +parser.add_option('--virtualenv',type='string',default='virtualenv', |
| 12 | + help='string to invoke virtualenv') |
| 13 | +parser.add_option('--easy-install-nose',action='store_true',default=False, |
| 14 | + help='run "easy_install nose" in the virtualenv') |
| 15 | +(options, args) = parser.parse_args() |
| 16 | +if len(args)!=0: |
| 17 | + parser.print_help() |
| 18 | + sys.exit(0) |
| 19 | + |
8 | 20 | TARGET='PYmpl' |
9 | 21 |
|
10 | 22 | if os.path.exists(TARGET): |
|
15 | 27 | if os.path.exists(build_path): |
16 | 28 | shutil.rmtree(build_path) |
17 | 29 |
|
18 | | -check_call('virtualenv %s'%(TARGET,)) |
| 30 | +check_call('%s %s'%(options.virtualenv,TARGET)) |
19 | 31 | TARGET_py = os.path.join(TARGET,'bin','python') |
| 32 | +TARGET_easy_install = os.path.join(TARGET,'bin','easy_install') |
| 33 | + |
| 34 | +if options.easy_install_nose: |
| 35 | + check_call('%s nose'%TARGET_easy_install) |
20 | 36 | check_call('%s setup.py install'%TARGET_py) |
0 commit comments