diff --git a/recipes/README.recipes.md b/recipes/README.recipes.md index a82071c8a..579037e5a 100644 --- a/recipes/README.recipes.md +++ b/recipes/README.recipes.md @@ -757,7 +757,7 @@ Raises: Return a presubmit step. -— **def [execute](/recipes/recipe_modules/presubmit/api.py#74)(self, bot_update_step):** +— **def [execute](/recipes/recipe_modules/presubmit/api.py#75)(self, bot_update_step):** Runs presubmit and sets summary markdown if applicable. @@ -766,7 +766,7 @@ Args: Returns: a RawResult object, suitable for being returned from RunSteps. -— **def [prepare](/recipes/recipe_modules/presubmit/api.py#39)(self):** +— **def [prepare](/recipes/recipe_modules/presubmit/api.py#40)(self):** Set up a presubmit run. diff --git a/recipes/recipe_modules/presubmit/api.py b/recipes/recipe_modules/presubmit/api.py index 3fa7b9d4f..2d80f884a 100644 --- a/recipes/recipe_modules/presubmit/api.py +++ b/recipes/recipe_modules/presubmit/api.py @@ -27,6 +27,7 @@ class PresubmitApi(recipe_api.RecipeApi): def __call__(self, *args, **kwargs): """Return a presubmit step.""" + kwargs['venv'] = True name = kwargs.pop('name', 'presubmit') with self.m.depot_tools.on_path(): presubmit_args = list(args) + [ @@ -106,16 +107,10 @@ class PresubmitApi(recipe_api.RecipeApi): '--upstream', upstream, # '' if not in bot_update mode. ]) - venv = True - # TODO(iannucci): verify that presubmit_support.py correctly finds and - # uses .vpython files, then remove this configuration. - if self._vpython_spec_path: - venv = abs_root.join(self._vpython_spec_path) - raw_result = result_pb2.RawResult() step_json = self( *presubmit_args, - venv=venv, timeout=self._timeout_s, + timeout=self._timeout_s, # ok_ret='any' causes all exceptions to be ignored in this step ok_ret='any') # Set recipe result values diff --git a/recipes/recipe_modules/presubmit/examples/full.expected/basic.json b/recipes/recipe_modules/presubmit/examples/full.expected/basic.json index 030b8e0dd..bced784b0 100644 --- a/recipes/recipe_modules/presubmit/examples/full.expected/basic.json +++ b/recipes/recipe_modules/presubmit/examples/full.expected/basic.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/presubmit_support.py", "--json_output",