@@ -217,7 +217,7 @@ def body(self, new_body: str) -> None:
217
217
self ._body = new_body
218
218
219
219
@property
220
- def id (self ) -> int :
220
+ def id (self ) -> Optional [ int ] :
221
221
return self ._id
222
222
223
223
@property
@@ -226,12 +226,12 @@ def author(self) -> str:
226
226
return self ._author
227
227
228
228
@property
229
- def created (self ) -> datetime .datetime :
229
+ def created (self ) -> Optional [ datetime .datetime ] :
230
230
"""Datetime of creation of the comment."""
231
231
return self ._created
232
232
233
233
@property
234
- def edited (self ) -> datetime .datetime :
234
+ def edited (self ) -> Optional [ datetime .datetime ] :
235
235
"""Datetime of last edit of the comment."""
236
236
return self ._edited
237
237
@@ -256,7 +256,7 @@ def add_reaction(self, reaction: str) -> Reaction:
256
256
257
257
class IssueComment (Comment ):
258
258
@property
259
- def issue (self ) -> "Issue" :
259
+ def issue (self ) -> Optional [ "Issue" ] :
260
260
"""Issue of issue comment."""
261
261
return self ._parent
262
262
@@ -266,7 +266,7 @@ def __str__(self) -> str:
266
266
267
267
class PRComment (Comment ):
268
268
@property
269
- def pull_request (self ) -> "PullRequest" :
269
+ def pull_request (self ) -> Optional [ "PullRequest" ] :
270
270
"""Pull request of pull request comment."""
271
271
return self ._parent
272
272
@@ -642,12 +642,12 @@ def head_commit(self) -> str:
642
642
raise NotImplementedError ()
643
643
644
644
@property
645
- def target_branch_head_commit (self ) -> str :
645
+ def target_branch_head_commit (self ) -> Optional [ str ] :
646
646
"""Commit hash of the HEAD commit of the target branch."""
647
647
raise NotImplementedError ()
648
648
649
649
@property
650
- def merge_commit_sha (self ) -> str :
650
+ def merge_commit_sha (self ) -> Optional [ str ] :
651
651
"""
652
652
Commit hash of the merge commit of the pull request.
653
653
@@ -1009,12 +1009,12 @@ def set(
1009
1009
raise NotImplementedError ()
1010
1010
1011
1011
@property
1012
- def created (self ) -> datetime .datetime :
1012
+ def created (self ) -> Optional [ datetime .datetime ] :
1013
1013
"""Datetime of creating the commit status."""
1014
1014
raise NotImplementedError ()
1015
1015
1016
1016
@property
1017
- def edited (self ) -> datetime .datetime :
1017
+ def edited (self ) -> Optional [ datetime .datetime ] :
1018
1018
"""Datetime of editing the commit status."""
1019
1019
raise NotImplementedError ()
1020
1020
@@ -1230,7 +1230,7 @@ class GitService(OgrAbstractClass):
1230
1230
instance_url (str): URL of the git forge instance.
1231
1231
"""
1232
1232
1233
- instance_url : Optional [ str ] = None
1233
+ instance_url : str
1234
1234
1235
1235
def __init__ (self , ** _ : Any ) -> None :
1236
1236
pass
@@ -1326,7 +1326,9 @@ def list_projects(
1326
1326
1327
1327
1328
1328
class GitProject (OgrAbstractClass ):
1329
- def __init__ (self , repo : str , service : GitService , namespace : str ) -> None :
1329
+ def __init__ (
1330
+ self , repo : str , service : GitService , namespace : Optional [str ]
1331
+ ) -> None :
1330
1332
"""
1331
1333
Args:
1332
1334
repo: Name of the project.
@@ -1335,7 +1337,7 @@ def __init__(self, repo: str, service: GitService, namespace: str) -> None:
1335
1337
1336
1338
- GitHub: username or org name.
1337
1339
- GitLab: username or org name.
1338
- - Pagure: namespace (e.g. `"rpms"`).
1340
+ - Pagure: namespace (e.g. `"rpms"`). May be none.
1339
1341
1340
1342
In case of forks: `"fork/{username}/{namespace}"`.
1341
1343
"""
@@ -1916,7 +1918,7 @@ def get_username(self) -> str:
1916
1918
"""
1917
1919
raise NotImplementedError ()
1918
1920
1919
- def get_email (self ) -> str :
1921
+ def get_email (self ) -> Optional [ str ] :
1920
1922
"""
1921
1923
Returns:
1922
1924
Email of the user.
0 commit comments