mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Small improvements to typing (#1517)
Work through some of the errors when running mypy with --strict.
This commit is contained in:
@@ -25,7 +25,7 @@ class AuthenticatedUser(CompletableGithubObject):
|
||||
def _initAttributes(self) -> None: ...
|
||||
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
|
||||
def accept_invitation(self, invitation: Union[int, Invitation]) -> None: ...
|
||||
def add_to_emails(self, *emails) -> None: ...
|
||||
def add_to_emails(self, *emails: List[str]) -> None: ...
|
||||
def add_to_following(self, following: NamedUser) -> None: ...
|
||||
def add_to_starred(self, starred: Repository) -> None: ...
|
||||
def add_to_subscriptions(self, subscription: Repository) -> None: ...
|
||||
|
||||
@@ -115,7 +115,7 @@ class _BadAttribute:
|
||||
self, value: Any, expectedType: Any, exception: Optional[ValueError] = ...
|
||||
) -> None: ...
|
||||
@property
|
||||
def value(self): ...
|
||||
def value(self) -> Any: ...
|
||||
|
||||
class _NotSetType:
|
||||
def __repr__(self) -> str: ...
|
||||
|
||||
+10
-6
@@ -102,36 +102,40 @@ class Github:
|
||||
sort: Union[str, _NotSetType] = ...,
|
||||
order: Union[str, _NotSetType] = ...,
|
||||
highlight: bool = ...,
|
||||
**qualifiers
|
||||
**qualifiers: Dict[str, Any]
|
||||
) -> PaginatedList[ContentFile]: ...
|
||||
def search_commits(
|
||||
self,
|
||||
query: str,
|
||||
sort: Union[str, _NotSetType] = ...,
|
||||
order: Union[str, _NotSetType] = ...,
|
||||
**qualifiers
|
||||
**qualifiers: Dict[str, Any]
|
||||
) -> PaginatedList[Commit]: ...
|
||||
def search_issues(
|
||||
self,
|
||||
query: str,
|
||||
sort: Union[str, _NotSetType] = ...,
|
||||
order: Union[str, _NotSetType] = ...,
|
||||
**qualifiers
|
||||
**qualifiers: Dict[str, Any]
|
||||
) -> PaginatedList[Issue]: ...
|
||||
def search_repositories(
|
||||
self,
|
||||
query: str,
|
||||
sort: Union[str, _NotSetType] = ...,
|
||||
order: Union[str, _NotSetType] = ...,
|
||||
**qualifiers
|
||||
**qualifiers: Dict[str, Any]
|
||||
) -> PaginatedList[Repository]: ...
|
||||
def search_topics(self, query: str, **qualifiers) -> PaginatedList[Topic]: ...
|
||||
def search_topics(
|
||||
self,
|
||||
query: str,
|
||||
**qualifiers: Dict[str, Any]
|
||||
) -> PaginatedList[Topic]: ...
|
||||
def search_users(
|
||||
self,
|
||||
query: str,
|
||||
sort: Union[str, _NotSetType] = ...,
|
||||
order: Union[str, _NotSetType] = ...,
|
||||
**qualifiers
|
||||
**qualifiers: Dict[str, Any]
|
||||
) -> PaginatedList[NamedUser]: ...
|
||||
|
||||
class GithubIntegration:
|
||||
|
||||
@@ -6,8 +6,7 @@ from github.NamedUser import NamedUser
|
||||
from github.Repository import Repository
|
||||
|
||||
class Migration(CompletableGithubObject):
|
||||
def __repr__(self):
|
||||
str: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def _initAttributes(self) -> None: ...
|
||||
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
|
||||
@property
|
||||
|
||||
@@ -15,8 +15,7 @@ class Milestone(CompletableGithubObject):
|
||||
@property
|
||||
def closed_issues(self) -> int: ...
|
||||
@property
|
||||
def created_at(self):
|
||||
datetime: ...
|
||||
def created_at(self) -> datetime: ...
|
||||
@property
|
||||
def creator(self) -> NamedUser: ...
|
||||
def delete(self) -> None: ...
|
||||
|
||||
@@ -17,7 +17,7 @@ class HTTPRequestsConnectionClass:
|
||||
strict: bool = ...,
|
||||
timeout: Optional[int] = ...,
|
||||
retry: Any = ...,
|
||||
**kwargs
|
||||
**kwargs: Dict[str, str]
|
||||
) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def getresponse(self) -> RequestsResponse: ...
|
||||
@@ -33,7 +33,7 @@ class HTTPSRequestsConnectionClass:
|
||||
strict: bool = ...,
|
||||
timeout: Optional[int] = ...,
|
||||
retry: Any = ...,
|
||||
**kwargs
|
||||
**kwargs: Dict[str, str]
|
||||
) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def getresponse(self) -> RequestsResponse: ...
|
||||
@@ -83,7 +83,7 @@ class Requester:
|
||||
parameters: Dict[str, str] = ...,
|
||||
headers: Dict[str, str] = ...,
|
||||
input: Optional[str] = ...,
|
||||
encode: Callable = ...,
|
||||
encode: Callable[[str], str] = ...,
|
||||
) -> Tuple[int, Dict[str, Any], str]: ...
|
||||
def __requestRaw(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user