tokendb_updater: Use type annotations
Change-Id: Idf7d067998914acc8068b53b5aecdf34aa191ce9
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/181313
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/recipes/tokendb_updater.py b/recipes/tokendb_updater.py
index 3e7d03b..5a4a704 100644
--- a/recipes/tokendb_updater.py
+++ b/recipes/tokendb_updater.py
@@ -24,7 +24,9 @@
import re
import attr
+from PB.recipe_engine import result
from PB.recipes.pigweed.tokendb_updater import InputProperties, TokenPath
+from recipe_engine import recipe_api
DEPS = [
'fuchsia/auto_roller',
@@ -38,11 +40,19 @@
PROPERTIES = InputProperties
-def RunSteps(api, props): # pylint: disable=invalid-name
- checkout = api.checkout(props.checkout_options)
+def RunSteps(
+ api: recipe_api.RecipeScriptApi, props: InputProperties,
+) -> result.RawResult:
+ checkout: api.checkout.CheckoutContext = api.checkout(
+ props.checkout_options
+ )
- env = api.environment.init(checkout, props.environment_options)
- build = api.build.create(checkout.root, props.build_options)
+ env: api.environment.Environment = api.environment.init(
+ checkout, props.environment_options
+ )
+ build: api.build.BuildContext = api.build.create(
+ checkout.root, props.build_options
+ )
with env():
api.build(build)
@@ -61,7 +71,7 @@
if not props.auto_roller_options.remote:
props.auto_roller_options.remote = checkout.options.remote
- change = api.auto_roller.attempt_roll(
+ change: api.auto_roller.GerritChange = api.auto_roller.attempt_roll(
props.auto_roller_options,
repo_dir=checkout.root,
commit_message=f'[tokendb] Update for {checkout.revision()[0:15]}',