Reland "[run_script] Stop using api.python()"
This reverts commit 3733f83f5a9ecdeb73de5f8ce924bd68d6eb4982.
Reason for revert: relanding after fixing the firmware repo to always
use the correct vpython spec for all scripts.
Original change's description:
> Revert "[run_script] Stop using api.python()"
>
> This reverts commit e0c129d2aee1e23f2e8a8767e99fc8b2820bc435.
>
> Reason for revert: Broke the firmware builders :(
> https://ci.chromium.org/b/8828825951656567969
> Seems like the Python script invokes a tree of python subprocesses
> and they all implicitly rely on vpython. I'll look into fixing that
> next week.
>
> Original change's description:
> > [run_script] Stop using api.python()
> >
> > If a script relies on vpython then it should explicitly use a vpython
> > shebang, which will keep this recipe simple and also help with locally
> > reproducing builds since infra won't hold the script differently than a
> > local developer would.
> >
> > The only builders that rely on this feature are the firmware builders,
> > so before I land this I'll send changes to update those builders'
> > scripts to use vpython shebangs.
> >
> > Bug: 89307
> > Change-Id: I71f48db5b84f52ead4c3713d61abeff54fb44040
> > Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/recipes/+/610781
> > Reviewed-by: Anthony Fandrianto <atyfto@google.com>
> > Commit-Queue: Oliver Newman <olivernewman@google.com>
>
> Bug: 89307
> Change-Id: I97b7dfd45ceda94dbc0b346dd542f4993dd99455
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/recipes/+/613969
> Reviewed-by: RubberStamper 🤖 <android-build-ayeaye@system.gserviceaccount.com>
> Commit-Queue: Oliver Newman <olivernewman@google.com>
Bug: 89307
Change-Id: I21dc65ac5f688e624566bb5f7e042db9e84500b0
Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/recipes/+/614861
Reviewed-by: RubberStamper 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Reviewed-by: Anthony Fandrianto <atyfto@google.com>
Commit-Queue: Oliver Newman <olivernewman@google.com>
diff --git a/recipes/run_script.expected/sso.json b/recipes/run_script.expected/sso.json
index 2f6bca6..0282922 100644
--- a/recipes/run_script.expected/sso.json
+++ b/recipes/run_script.expected/sso.json
@@ -234,8 +234,6 @@
},
{
"cmd": [
- "vpython",
- "-u",
"run-tests.py",
"-flag",
"val"
@@ -257,8 +255,6 @@
},
{
"cmd": [
- "vpython",
- "-u",
"run-tests2.py",
"-flag",
"val",
diff --git a/recipes/run_script.py b/recipes/run_script.py
index 2f363ab..a692405 100644
--- a/recipes/run_script.py
+++ b/recipes/run_script.py
@@ -24,7 +24,6 @@
"recipe_engine/file",
"recipe_engine/path",
"recipe_engine/properties",
- "recipe_engine/python",
"recipe_engine/step",
]
@@ -96,13 +95,7 @@
cipd_yaml_manifest = api.path.mkstemp("cipd_manifest")
script_args += ["--cipd-yaml-manifest", cipd_yaml_manifest]
- step_name = "run %s" % script_config.script
- if script_config.script.endswith(".py"):
- # Run python scripts with vpython, rather than system Python, to
- # enable installation of packages via .vpython files.
- api.python(step_name, script_config.script, script_args, venv=True)
- else:
- api.step(step_name, [script_config.script] + script_args)
+ api.step("run %s" % script_config.script, [script_config.script] + script_args)
if script_config.upload_to_cipd:
upload_to_cipd(