Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: bootstrap/bootstrap_vpython.py

Issue 2933473002: [context] Split "env" values and prefixes. (Closed)
Patch Set: fix typo Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | recipe_engine/recipe_api.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2017 The LUCI Authors. All rights reserved. 2 # Copyright 2017 The LUCI Authors. All rights reserved.
3 # Use of this source code is governed under the Apache License, Version 2.0 3 # Use of this source code is governed under the Apache License, Version 2.0
4 # that can be found in the LICENSE file. 4 # that can be found in the LICENSE file.
5 5
6 import argparse 6 import argparse
7 import logging 7 import logging
8 import os 8 import os
9 import subprocess 9 import subprocess
10 import sys 10 import sys
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 vpython_path = os.path.join(cipd_root, 'vpython' + EXE_EXTENSION) 51 vpython_path = os.path.join(cipd_root, 'vpython' + EXE_EXTENSION)
52 if not os.path.isfile(vpython_path): 52 if not os.path.isfile(vpython_path):
53 raise ValueError('`vpython` not found at [%s]' % (vpython_path,)) 53 raise ValueError('`vpython` not found at [%s]' % (vpython_path,))
54 return vpython_path 54 return vpython_path
55 55
56 56
57 def main(args): 57 def main(args):
58 parser = argparse.ArgumentParser() 58 parser = argparse.ArgumentParser()
59 parser.add_argument('--venv-spec', metavar='PATH', 59 parser.add_argument('--venv-spec', metavar='PATH',
60 default=os.path.join(ROOT, 'bootstrap', 'venv.cfg'), 60 default=os.path.join(ROOT, 'bootstrap', 'venv.cfg'),
61 help='Path to vpython enviornment specification file to use (default ' 61 help='Path to vpython environment specification file to use (default '
62 'is %(default)s).') 62 'is %(default)s).')
63 parser.add_argument('--vpython-path', metavar='PATH', 63 parser.add_argument('--vpython-path', metavar='PATH',
64 help='Use "vpython" binary at PATH, instead of the bootstrap default.') 64 help='Use "vpython" binary at PATH, instead of the bootstrap default.')
65 parser.add_argument('-v', '--verbose', action='count', default=0, 65 parser.add_argument('-v', '--verbose', action='count', default=0,
66 help='Increase verbosity. Can be specified multiple times.') 66 help='Increase verbosity. Can be specified multiple times.')
67 parser.add_argument('--presubmit', action='store_true', 67 parser.add_argument('--presubmit', action='store_true',
68 help='Run PRESUBMIT check and exit, zero on success, non-zero on ' 68 help='Run PRESUBMIT check and exit, zero on success, non-zero on '
69 'failure.') 69 'failure.')
70 parser.add_argument('args', nargs='*', 70 parser.add_argument('args', nargs='*',
71 help='Flags and arguments to pass to the target Python script.') 71 help='Flags and arguments to pass to the target Python script.')
(...skipping 26 matching lines...) Expand all
98 return subprocess.call(vpython_args) 98 return subprocess.call(vpython_args)
99 99
100 vpython_args += ['--'] + opts.args 100 vpython_args += ['--'] + opts.args
101 LOGGER.debug('Executing bootstrapped Python: %s', vpython_args) 101 LOGGER.debug('Executing bootstrapped Python: %s', vpython_args)
102 return subprocess.call(vpython_args) 102 return subprocess.call(vpython_args)
103 103
104 104
105 if __name__ == '__main__': 105 if __name__ == '__main__':
106 logging.basicConfig() 106 logging.basicConfig()
107 sys.exit(main(sys.argv[1:])) 107 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | recipe_engine/recipe_api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698