Commit ed6aa2b0 authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

Reland "Use py3 in bot_update and gclient recipe_modules"

This is a reland of bb88492f

Original change's description:
> Use py3 in bot_update and gclient recipe_modules
>
> Recipe-Nontrivial-Roll: build
> Recipe-Nontrivial-Roll: build_limited
> Recipe-Nontrivial-Roll: chrome_release
> Recipe-Nontrivial-Roll: chromiumos
> Recipe-Nontrivial-Roll: infra
> Bug: 1289280
> Change-Id: Id61bacf4acef319f7ea22161081b632677ca363c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3402082
> Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>

Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited
Recipe-Nontrivial-Roll: chrome_release
Recipe-Nontrivial-Roll: chromiumos
Recipe-Nontrivial-Roll: infra
Bug: 1289280, 1289504
Change-Id: I2f2f7244568b1fdfb960d5cdfa3937175ac1ed2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3414742Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
Reviewed-by: 's avatarYiwei Zhang <yiwzhang@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
parent d05a2e03
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......
......@@ -58,12 +58,12 @@ Recipe module to ensure a checkout is consistent on a bot.
Wrapper for easy calling of bot_update.
&mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#532)(self, bot_update_step):**
&mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#534)(self, bot_update_step):**
Deapplies a patch, taking care of DEPS and solution revisions properly.
&mdash; **def [ensure\_checkout](/recipes/recipe_modules/bot_update/api.py#79)(self, gclient_config=None, suffix=None, patch=True, update_presentation=True, patch_root=None, with_branch_heads=False, with_tags=False, no_fetch_tags=False, refs=None, patch_oauth2=None, oauth2_json=None, use_site_config_creds=None, clobber=False, root_solution_revision=None, rietveld=None, issue=None, patchset=None, gerrit_no_reset=False, gerrit_no_rebase_patch_ref=False, assert_one_gerrit_change=True, disable_syntax_validation=False, patch_refs=None, ignore_input_commit=False, add_blamelists=False, set_output_commit=False, step_test_data=None, enforce_fetch=False, \*\*kwargs):**
&mdash; **def [ensure\_checkout](/recipes/recipe_modules/bot_update/api.py#81)(self, gclient_config=None, suffix=None, patch=True, update_presentation=True, patch_root=None, with_branch_heads=False, with_tags=False, no_fetch_tags=False, refs=None, patch_oauth2=None, oauth2_json=None, use_site_config_creds=None, clobber=False, root_solution_revision=None, rietveld=None, issue=None, patchset=None, gerrit_no_reset=False, gerrit_no_rebase_patch_ref=False, assert_one_gerrit_change=True, disable_syntax_validation=False, patch_refs=None, ignore_input_commit=False, add_blamelists=False, set_output_commit=False, step_test_data=None, enforce_fetch=False, \*\*kwargs):**
Args:
* gclient_config: The gclient configuration to use when running bot_update.
......@@ -95,7 +95,7 @@ Args:
bot_update module ONLY supports one change. Users may specify a change
via tryserver.set_change() and explicitly set this flag False.
&mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#509)(self, project_name, gclient_config=None):**
&mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#511)(self, project_name, gclient_config=None):**
Returns all property names used for storing the checked-out revision of
a given project.
......@@ -109,9 +109,9 @@ Args:
Returns (list of str): All properties that'll hold the checked-out revision
of the given project. An empty list if no such properties exist.
&emsp; **@property**<br>&mdash; **def [last\_returned\_properties](/recipes/recipe_modules/bot_update/api.py#47)(self):**
&emsp; **@property**<br>&mdash; **def [last\_returned\_properties](/recipes/recipe_modules/bot_update/api.py#49)(self):**
&mdash; **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#460)(self, bot_update_json, name):**
&mdash; **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#462)(self, bot_update_json, name):**
Sets a fixed revision for a single dependency using project revision
properties.
......
......@@ -42,7 +42,9 @@ class BotUpdateApi(recipe_api.RecipeApi):
self.m.buildbucket.build.id)
with self.m.context(env=env):
with self.m.depot_tools.on_path():
return self.m.python(name, bot_update_path, cmd, **kwargs)
return self.m.step(name,
['python3', '-u', bot_update_path] + cmd,
**kwargs)
@property
def last_returned_properties(self):
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -113,7 +113,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
......@@ -56,7 +56,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -146,7 +146,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -113,7 +113,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -113,7 +113,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -123,7 +123,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -116,7 +116,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
......@@ -56,7 +56,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -186,7 +186,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -114,7 +114,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -112,7 +112,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
......@@ -56,7 +56,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
......@@ -56,7 +56,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
......@@ -56,7 +56,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
......@@ -56,7 +56,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -186,7 +186,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
......@@ -56,7 +56,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -185,7 +185,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
......@@ -56,7 +56,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -185,7 +185,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
......@@ -56,7 +56,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -186,7 +186,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
......@@ -56,7 +56,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -196,7 +196,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
......@@ -56,7 +56,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -186,7 +186,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
......@@ -56,7 +56,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -186,7 +186,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -113,7 +113,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......@@ -113,7 +113,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
......
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......@@ -231,7 +231,7 @@ def call(*args, **kwargs): # pragma: no cover
if not buf:
break
if hanging_cr:
buf = '\r' + buf
buf = b'\r' + buf
hanging_cr = buf.endswith(b'\r')
if hanging_cr:
buf = buf[:-1]
......
......@@ -100,11 +100,11 @@ class GclientApi(recipe_api.RecipeApi):
self.m.buildbucket.build.builder.builder,
self.m.buildbucket.build.id)
with self.m.context(env=env, env_suffixes=env_suffixes):
return self.m.python(prefix + name,
self.repo_resource('gclient.py'),
cmd,
infra_step=infra_step,
**kwargs)
cmd = ['python3', '-u', self.repo_resource('gclient.py')] + cmd
return self.m.step(prefix + name,
cmd,
infra_step=infra_step,
**kwargs)
@property
def use_mirror(self):
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"config",
......@@ -18,7 +18,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"sync",
......@@ -55,7 +55,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
......@@ -74,7 +74,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
......@@ -93,7 +93,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"config",
......@@ -111,7 +111,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"sync",
......@@ -155,7 +155,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
......@@ -175,7 +175,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
......@@ -220,7 +220,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"runhooks"
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"config",
......@@ -33,7 +33,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"sync",
......@@ -87,7 +87,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
......@@ -121,7 +121,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
......@@ -155,7 +155,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"config",
......@@ -188,7 +188,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"sync",
......@@ -247,7 +247,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
......@@ -282,7 +282,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
......@@ -354,7 +354,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"runhooks"
......
[
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"config",
......@@ -33,7 +33,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"sync",
......@@ -85,7 +85,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
......@@ -119,7 +119,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
......@@ -153,7 +153,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"config",
......@@ -186,7 +186,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"sync",
......@@ -245,7 +245,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
......@@ -280,7 +280,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
......@@ -352,7 +352,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"runhooks"
......
......@@ -27,7 +27,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
......
......@@ -27,7 +27,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
......
......@@ -27,7 +27,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
......
......@@ -27,7 +27,7 @@
},
{
"cmd": [
"python",
"python3",
"-u",
"RECIPE_REPO[depot_tools]\\gclient.py",
"recurse",
......
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