Browse Source

Reland "Use py3 in gitiles recipe module"

This is a reland of 0faae1c8455edaed075218d5ebe0a62588ffed78

Original change's description:
> Use py3 in gitiles recipe module
>
> Recipe-Nontrivial-Roll: build
> Recipe-Nontrivial-Roll: chrome_release
> Recipe-Nontrivial-Roll: chromiumos
> Bug: 1289280
> Change-Id: I182f0e7ad1da58c1c707edd15675f6d30c5faed8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3438327
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Gavin Mak <gavinmak@google.com>

Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: chrome_release
Recipe-Nontrivial-Roll: chromiumos
Bug: 1289280
Change-Id: I9ba63a7cd4fea99c2043fae546c63ef942c82802
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3445785
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Josip Sokcevic 3 năm trước cách đây
mục cha
commit
274ada0567

+ 4 - 4
.vpython3

@@ -24,6 +24,10 @@ wheel: <
   name: "infra/python/wheels/httplib2-py3"
   name: "infra/python/wheels/httplib2-py3"
   version: "version:0.13.1"
   version: "version:0.13.1"
 >
 >
+wheel: <
+  name: "infra/python/wheels/six-py2_py3"
+  version: "version:1.10.0"
+>
 
 
 # Used by:
 # Used by:
 #    presubmit_support.py
 #    presubmit_support.py
@@ -38,10 +42,6 @@ wheel: <
   name: "infra/python/wheels/python-dateutil-py2_py3"
   name: "infra/python/wheels/python-dateutil-py2_py3"
   version: "version:2.7.3"
   version: "version:2.7.3"
 >
 >
-wheel: <
-  name: "infra/python/wheels/six-py2_py3"
-  version: "version:1.10.0"
->
 
 
 # May be required to talk to 3P servers.
 # May be required to talk to 3P servers.
 # Fixes https://crbug.com/1255921
 # Fixes https://crbug.com/1255921

+ 2 - 2
recipes/recipe_modules/gitiles/api.py

@@ -57,8 +57,8 @@ class Gitiles(recipe_api.RecipeApi):
       args.extend([
       args.extend([
           '--accept-statuses',
           '--accept-statuses',
           ','.join([str(s) for s in accept_statuses])])
           ','.join([str(s) for s in accept_statuses])])
-    return self.m.python(
-        step_name, self.resource('gerrit_client.py'), args, **kwargs)
+    cmd = ['vpython3', '-u', self.resource('gerrit_client.py')] + args
+    return self.m.step(step_name, cmd, **kwargs)
 
 
   def refs(self, url, step_name='refs', attempts=None):
   def refs(self, url, step_name='refs', attempts=None):
     """Returns a list of refs in the remote repository."""
     """Returns a list of refs in the remote repository."""

+ 10 - 10
recipes/recipe_modules/gitiles/examples/full.expected/basic.json

@@ -1,7 +1,7 @@
 [
 [
   {
   {
     "cmd": [
     "cmd": [
-      "python",
+      "vpython3",
       "-u",
       "-u",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "--json-file",
       "--json-file",
@@ -27,7 +27,7 @@
   },
   },
   {
   {
     "cmd": [
     "cmd": [
-      "python",
+      "vpython3",
       "-u",
       "-u",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "--json-file",
       "--json-file",
@@ -136,7 +136,7 @@
   },
   },
   {
   {
     "cmd": [
     "cmd": [
-      "python",
+      "vpython3",
       "-u",
       "-u",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "--json-file",
       "--json-file",
@@ -246,7 +246,7 @@
   },
   },
   {
   {
     "cmd": [
     "cmd": [
-      "python",
+      "vpython3",
       "-u",
       "-u",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "--json-file",
       "--json-file",
@@ -354,7 +354,7 @@
   },
   },
   {
   {
     "cmd": [
     "cmd": [
-      "python",
+      "vpython3",
       "-u",
       "-u",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "--json-file",
       "--json-file",
@@ -462,7 +462,7 @@
   },
   },
   {
   {
     "cmd": [
     "cmd": [
-      "python",
+      "vpython3",
       "-u",
       "-u",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "--json-file",
       "--json-file",
@@ -515,7 +515,7 @@
   },
   },
   {
   {
     "cmd": [
     "cmd": [
-      "python",
+      "vpython3",
       "-u",
       "-u",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "--json-file",
       "--json-file",
@@ -531,7 +531,7 @@
   },
   },
   {
   {
     "cmd": [
     "cmd": [
-      "python",
+      "vpython3",
       "-u",
       "-u",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "--json-file",
       "--json-file",
@@ -549,7 +549,7 @@
   },
   },
   {
   {
     "cmd": [
     "cmd": [
-      "python",
+      "vpython3",
       "-u",
       "-u",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "--json-file",
       "--json-file",
@@ -568,7 +568,7 @@
   },
   },
   {
   {
     "cmd": [
     "cmd": [
-      "python",
+      "vpython3",
       "-u",
       "-u",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "RECIPE_MODULE[depot_tools::gitiles]/resources/gerrit_client.py",
       "--json-file",
       "--json-file",

+ 1 - 1
recipes/recipe_modules/gitiles/resources/gerrit_client.py

@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env vpython3
 # Copyright 2014 The Chromium Authors. All rights reserved.
 # Copyright 2014 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 # found in the LICENSE file.

+ 11 - 0
recipes/recipe_modules/gitiles/resources/gerrit_client.py.vpython3

@@ -0,0 +1,11 @@
+python_version: "3.8"
+
+wheel: <
+  name: "infra/python/wheels/httplib2-py3"
+  version: "version:0.13.1"
+>
+
+wheel: <
+  name: "infra/python/wheels/six-py2_py3"
+  version: "version:1.10.0"
+>