Commit 3d1a52e0 authored by Garrett Beaty's avatar Garrett Beaty Committed by LUCI CQ

Remove recipe warnings due to python module.

The python module is deprecated in favor of using the step module with
an explicit python binary. Switching the code to use the step module and
remove DEPS on recipe_engine/python removes warnings when running recipe
tests in the repo.

Change-Id: If3c9d5d6aff5aab69898b535399accbef92f5c0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3880624
Commit-Queue: Garrett Beaty <gbeaty@google.com>
Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
parent 787e71ac
This diff is collapsed.
......@@ -14,7 +14,6 @@ DEPS = [
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/raw_io',
'recipe_engine/runtime',
'recipe_engine/step',
......
......@@ -9,7 +9,6 @@ DEPS = [
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/raw_io',
'recipe_engine/step',
'tryserver',
......
......@@ -8,7 +8,6 @@ DEPS = [
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/raw_io',
'recipe_engine/step',
]
PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
DEPS = [
'recipe_engine/context',
'recipe_engine/python',
'recipe_engine/raw_io',
'recipe_engine/context',
'recipe_engine/raw_io',
'recipe_engine/step',
]
......@@ -16,10 +16,9 @@ class GitClApi(recipe_api.RecipeApi):
name = name + ' (%s)' % kwargs.pop('suffix')
my_loc = self.c.repo_location if self.c else None
cmd = ['vpython', self.repo_resource('git_cl.py'), subcmd] + args
with self.m.context(cwd=self.m.context.cwd or my_loc):
return self.m.python(
name, self.repo_resource('git_cl.py'), [subcmd] + args,
venv=True, **kwargs)
return self.m.step(name, cmd, **kwargs)
def get_description(self, patch_url=None, **kwargs):
"""DEPRECATED. Consider using gerrit.get_change_description instead."""
......
......@@ -7,7 +7,6 @@ PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
DEPS = [
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/python',
'recipe_engine/raw_io',
'recipe_engine/step',
'recipe_engine/url',
......
......@@ -20,7 +20,6 @@ DEPS = [
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/step',
'recipe_engine/resultdb',
'tryserver',
......
......@@ -28,22 +28,18 @@ class PresubmitApi(recipe_api.RecipeApi):
def __call__(self, *args, **kwargs):
"""Returns a presubmit step."""
kwargs['venv'] = True
name = kwargs.pop('name', 'presubmit')
with self.m.depot_tools.on_path():
presubmit_args = list(args) + [
'--json_output', self.m.json.output(),
]
cmd = ['vpython', self.presubmit_support_path]
cmd.extend(args)
cmd.extend(['--json_output', self.m.json.output()])
if self.m.resultdb.enabled:
kwargs['wrapper'] = ('rdb', 'stream', '--')
step_data = self.m.python(
name, self.presubmit_support_path, presubmit_args, **kwargs)
step_data = self.m.step(name, cmd, **kwargs)
output = step_data.json.output or {}
if self.m.step.active_result.retcode != 0:
return output
# Run with vpython3 directly
del (kwargs['venv'])
presubmit_args = list(args) + [
'--json_output',
self.m.json.output(),
......
......@@ -12,7 +12,6 @@ DEPS = [
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/step',
'tryserver',
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment