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

Unified Diff: recipes.py

Issue 2061263003: add basic bootstrap for coverage (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/recipes-py@master
Patch Set: Add recipes.py flag. Created 4 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 side-by-side diff with in-line comments
Download patch
« bootstrap/bootstrap.py ('K') | « bootstrap/util.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipes.py
diff --git a/recipes.py b/recipes.py
index 2d59293e4f203d2ac00bbe25b9fcf792c8dddea3..f0173ecf68d9cacc1e90d4dc6e25f361f2f9e441 100755
--- a/recipes.py
+++ b/recipes.py
@@ -218,6 +218,7 @@ def info(args):
def main():
+ sysargs = sys.argv
Paweł Hajdan Jr. 2016/06/15 10:56:19 What's the intention of this code? It doesn't see
martiniss 2016/06/15 20:36:53 I moved this to where we mutate sys.argv, and made
from recipe_engine import package
# Super-annoyingly, we need to manually parse for simulation_test since
@@ -249,6 +250,10 @@ def main():
parser.add_argument('-O', '--project-override', metavar='ID=PATH',
action=ProjectOverrideAction,
help='Override a project repository path with a local one.')
+ parser.add_argument(
+ '--use-bootstrap', action='store_true',
+ help='Use bootstrap/bootstrap.py to create a isolated python virtualenv'
+ ' with required python dependencies.')
subp = parser.add_subparsers()
@@ -376,6 +381,16 @@ def main():
args = parser.parse_args()
+ if args.use_bootstrap:
+ subprocess.check_call(
+ ['bootstrap/bootstrap.py', '--deps-file', 'bootstrap/deps.pyl', 'ENV'],
Paweł Hajdan Jr. 2016/06/15 10:56:19 nit: Start with sys.executable .
martiniss 2016/06/15 20:36:53 Done.
+ cwd=os.path.dirname(os.path.realpath(__file__)))
+
+ args = [arg for arg in sysargs[1:] if 'use-bootstrap' not in arg]
Paweł Hajdan Jr. 2016/06/15 10:56:19 nit: This might interfere with other legitimate ar
martiniss 2016/06/15 20:36:53 I used an environment variable, like update script
+ return subprocess.call(
+ ['ENV/bin/python', 'recipes.py'] + args,
+ cwd=os.path.dirname(os.path.realpath(__file__)))
+
if args.verbose:
logging.getLogger().setLevel(logging.INFO)
« bootstrap/bootstrap.py ('K') | « bootstrap/util.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698