Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/taskgraph/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def _run(self):
if parameters["enable_always_target"]:
always_target_tasks = {
t.label
for t in full_task_graph.tasks.values() # type: ignore
for t in full_task_graph.tasks.values()
if t.attributes.get("always_target")
if parameters["enable_always_target"] is True
or t.kind in parameters["enable_always_target"]
Expand All @@ -388,7 +388,7 @@ def _run(self):
target_graph = full_task_graph.graph.transitive_closure(requested_tasks)
target_task_graph = TaskGraph(
{l: all_tasks[l] for l in target_graph.nodes},
target_graph, # type: ignore
target_graph,
)
yield self.verify(
"target_task_graph", target_task_graph, graph_config, parameters
Expand Down
2 changes: 1 addition & 1 deletion src/taskgraph/taskgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __contains__(self, label):

def __iter__(self):
"Iterate over tasks in undefined order"
return iter(self.tasks.values()) # type: ignore
return iter(self.tasks.values())

def to_json(self):
"Return a JSON-able object representing the task graph, as documented"
Expand Down
4 changes: 2 additions & 2 deletions src/taskgraph/util/cached_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def add_optimization(
"""
if (digest is None) == (digest_data is None):
raise Exception("Must pass exactly one of `digest` and `digest_data`.")
if digest is None:
digest = hashlib.sha256("\n".join(digest_data).encode("utf-8")).hexdigest() # type: ignore
elif digest is None and digest_data is not None:
digest = hashlib.sha256("\n".join(digest_data).encode("utf-8")).hexdigest()

if "cached-task-prefix" in config.graph_config["taskgraph"]:
cache_prefix = config.graph_config["taskgraph"]["cached-task-prefix"]
Expand Down
4 changes: 2 additions & 2 deletions src/taskgraph/util/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.


import collections
import pprint
import re
from collections.abc import Mapping

import voluptuous

Expand Down Expand Up @@ -184,7 +184,7 @@ def check_identifier(path, k):
f"Unexpected type in YAML schema: {type(k).__name__} @ {path}"
)

if isinstance(sch, collections.abc.Mapping): # type: ignore
if isinstance(sch, Mapping):
for k, v in sch.items():
child = f"{path}[{k!r}]"
check_identifier(child, k)
Expand Down
7 changes: 4 additions & 3 deletions src/taskgraph/util/taskcluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def find_task_id(index_path, use_proxy=False):
try:
response = _do_request(get_index_url(index_path, use_proxy))
except requests.exceptions.HTTPError as e:
if e.response.status_code == 404: # type: ignore
if e.response.status_code == 404:
raise KeyError(f"index path {index_path} not found")
raise
return response.json()["taskId"]
Expand Down Expand Up @@ -306,7 +306,7 @@ def cancel_task(task_id, use_proxy=False):
def status_task(task_id, use_proxy=False):
"""Gets the status of a task given a task_id.

In testing mode, just logs that it would have retrieved status.
In testing mode, just logs that it would have retrieved status and return an empty dict.

Args:
task_id (str): A task id.
Expand All @@ -318,6 +318,7 @@ def status_task(task_id, use_proxy=False):
"""
if testing:
logger.info(f"Would have gotten status for {task_id}.")
return {}
else:
resp = _do_request(get_task_url(task_id, use_proxy) + "/status")
status = resp.json().get("status", {})
Expand Down Expand Up @@ -385,7 +386,7 @@ def state_task(task_id, use_proxy=False):
if testing:
logger.info(f"Would have gotten state for {task_id}.")
else:
status = status_task(task_id, use_proxy=use_proxy).get("state") or "unknown" # type: ignore
status = status_task(task_id, use_proxy=use_proxy).get("state") or "unknown"
return status


Expand Down
Loading