Skip to content

Commit 8339a75

Browse files
committed
upgrade to ty 0.49
1 parent 228e958 commit 8339a75

5 files changed

Lines changed: 23 additions & 23 deletions

File tree

bugwarrior/services/azuredevops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def annotations(self, issue: dict[str, Any]) -> list[str]:
242242
name = comment["revisedBy"]["displayName"]
243243
except KeyError:
244244
name = comment["modifiedBy"]["displayName"]
245-
text = format_item(comment["text"])
245+
text = format_item(comment["text"]) or ""
246246
annotations.append((name, text))
247247
return self.build_annotations(annotations, url)
248248

bugwarrior/services/bitbucket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def __init__(
113113
'bitbucket_refresh_token', response['refresh_token']
114114
)
115115

116-
self.requests_kwargs = {
116+
self.requests_kwargs: dict[str, Any] = {
117117
'headers': {'Authorization': f"Bearer {response['access_token']}"}
118118
}
119119

bugwarrior/services/pivotaltracker.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -170,25 +170,25 @@ def blockers(self, blocker_list: list[dict[str, Any]]) -> str | None:
170170
def issues(self) -> Iterator[PivotalTrackerIssue]:
171171
for project in self.get_projects(self.config.account_ids):
172172
project_id = project.get('id')
173-
if project_id not in self.config.exclude_projects:
174-
for story in self.get_query(project_id, query=self.query):
175-
story_id = story.get('id')
176-
if story_id is None:
177-
continue
178-
tasks = self.get_tasks(project_id, story_id)
179-
blockers = self.get_blockers(project_id, story_id)
180-
extra = {
181-
'project_name': project.get('name'),
182-
'annotations': self.annotations(tasks, story),
183-
'owned_user': self.get_user_by_id(
184-
project_id, story['owner_ids']
185-
),
186-
'request_user': self.get_user_by_id(
187-
project_id, [story['requested_by_id']]
188-
),
189-
'blockers': self.blockers(blockers),
190-
}
191-
yield self.get_issue_for_record(story, extra)
173+
if project_id is None or project_id in self.config.exclude_projects:
174+
continue
175+
176+
for story in self.get_query(project_id, query=self.query):
177+
story_id = story.get('id')
178+
if story_id is None:
179+
continue
180+
tasks = self.get_tasks(project_id, story_id)
181+
blockers = self.get_blockers(project_id, story_id)
182+
extra = {
183+
'project_name': project.get('name'),
184+
'annotations': self.annotations(tasks, story),
185+
'owned_user': self.get_user_by_id(project_id, story['owner_ids']),
186+
'request_user': self.get_user_by_id(
187+
project_id, [story['requested_by_id']]
188+
),
189+
'blockers': self.blockers(blockers),
190+
}
191+
yield self.get_issue_for_record(story, extra)
192192

193193
def api_request(self, endpoint: str, params: dict[str, Any] | None = None) -> Any:
194194
"""

bugwarrior/services/trac.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def annotations(self, issue: dict[str, Any]) -> list[str]:
106106
annotations = []
107107
# without offtrac, we can't get issue comments
108108
if self.trac is None:
109-
return annotations
109+
return []
110110
changelog = typing.cast(
111111
list, self.trac.server.ticket.changeLog(issue['number'])
112112
)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,5 +141,5 @@ test = [
141141
"responses",
142142
# ruff and ty are required by tests/test_general.py
143143
"ruff",
144-
"ty==0.0.32",
144+
"ty==0.0.49",
145145
]

0 commit comments

Comments
 (0)