Skip to content

Commit 5020b6a

Browse files
style: pre-commit.ci auto fixes [...]
1 parent e2fe3b9 commit 5020b6a

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

taskcluster/fxci_config_taskgraph/util/integration.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44

55
import copy
66
from functools import cache
7-
from typing import Any, Dict, List, Union
7+
from typing import Any
8+
89
import requests
910
import taskcluster
10-
from taskgraph.util.taskcluster import get_task_url, get_session
1111
from taskgraph.util.memoize import memoize
12+
from taskgraph.util.taskcluster import get_session, get_task_url
1213

1314
FIREFOXCI_ROOT_URL = "https://firefox-ci-tc.services.mozilla.com"
1415
STAGING_ROOT_URL = "https://stage.taskcluster.nonprod.cloudops.mozgcp.net"
1516

17+
1618
def _do_request(url, method=None, **kwargs):
1719
if method is None:
1820
method = "post" if kwargs else "get"
@@ -50,9 +52,7 @@ def _get_deps(task_ids, use_proxy):
5052
return upstream_tasks
5153

5254

53-
def get_ancestors(
54-
task_ids: Union[List[str], str], use_proxy: bool = False
55-
) -> Dict[str, str]:
55+
def get_ancestors(task_ids: list[str] | str, use_proxy: bool = False) -> dict[str, str]:
5656
"""Gets the ancestor tasks of the given task_ids as a dictionary of label -> taskid.
5757
5858
Args:
@@ -62,7 +62,7 @@ def get_ancestors(
6262
Returns:
6363
dict: A dict whose keys are task labels and values are task ids.
6464
"""
65-
upstream_tasks: Dict[str, str] = {}
65+
upstream_tasks: dict[str, str] = {}
6666

6767
if isinstance(task_ids, str):
6868
task_ids = [task_ids]
@@ -74,14 +74,17 @@ def get_ancestors(
7474

7575
return copy.deepcopy(upstream_tasks)
7676

77+
7778
@cache
7879
def get_taskcluster_client(service: str):
7980
options = {"rootUrl": FIREFOXCI_ROOT_URL}
8081
return getattr(taskcluster, service.capitalize())(options)
8182

8283

8384
@cache
84-
def find_tasks(decision_index_path: str, include_deps: bool = False) -> list[dict[str, Any]]:
85+
def find_tasks(
86+
decision_index_path: str, include_deps: bool = False
87+
) -> list[dict[str, Any]]:
8588
"""Find tasks targeted by the Decision task pointed to by `decision_index_path`."""
8689
queue = get_taskcluster_client("queue")
8790
index = get_taskcluster_client("index")
@@ -115,6 +118,7 @@ def find_tasks(decision_index_path: str, include_deps: bool = False) -> list[dic
115118
if include_deps:
116119
# TODO: remove hack
117120
import os
121+
118122
orig = os.environ["TASKCLUSTER_ROOT_URL"]
119123
os.environ["TASKCLUSTER_ROOT_URL"] = FIREFOXCI_ROOT_URL
120124
for label, task_id in get_ancestors(task["task_id"]).items():

0 commit comments

Comments
 (0)