mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 03:41:08 +00:00
Type stubs for mypy (#1231)
* First attempt at stubs * fix AuthenticatedUser.piy * fix PullRequest.piy * fix Authorization.piy * fix Branch.piy * fix Clones.piy * fix Commit.piy * fix CommitCombinedStatus.piy * fix CommitComment.piy * fix CommitStatus.piy * fix ContentFile.piy * fix Download.piy * fix Event.piy * fix File.piy * fix Gist.piy * fix GistComment.piy * fix GistFile.piy * fix GitAuthor.piy * fix GitBlob.piy * fix GitCommit.piy * fix GitRef.piy * fix GitRelease.piy * renamed stubs into pyi files * fix Notification * fix Repository * fix GitReleaseAsset * fix GitTag * fix GitTree * fix GitTreeElement * fix GithubException * fix GithubObject * fix GitignoreTemplate * fix HookDescription * fix HookResponse * fix InputGitAuthor * fix Installation * fix InstallationAuthorization * fix Invitation * fix Issue * fix IssueComment * Fix random issues found while testing * fix IssuePullRequest * fix Label * fix License * fix Migration * fix Milestone * fix NamedUser * fix NotificationSubject * fix Organization * fix PaginatedList * fix Path * fix Permissions * fix Plan * fix Project * fix ProjectCard * fix ProjectColumn * fix PullRequestComment * fix PullRequestMergeStatus * fix PullRequestPart * fix PullRequestReview * fix Rate * fix RateLimit * fix Reaction * fix Referrer * fix RepositoryKey * fix RequiredPullRequestReviews * fix RequiredStatusChecks * fix SourceImport * fix Stargazer * fix StatsCodeFrequency * fix StatsCommitActivity * fix StatsContributor * fix Tag * fix Team * fix Topic * fix UserKey * fix MainClass * fix Requester * added stubs for View * added stubs for Membership * various syntax errors * silence mypy noise * keeping track of recent changes * black + isort Co-authored-by: Liuyang Wan <lwan@zendesk.com>
This commit is contained in:
co-authored by
Liuyang Wan
parent
1440297699
commit
91433fe925
@@ -0,0 +1,124 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Type, Union
|
||||
|
||||
from github.Commit import Commit
|
||||
from github.GistFile import GistFile
|
||||
from github.GitRelease import GitRelease
|
||||
from github.NamedUser import NamedUser
|
||||
from github.Organization import Organization
|
||||
from github.PullRequestReview import PullRequestReview
|
||||
from github.Requester import Requester
|
||||
|
||||
class CompletableGithubObject:
|
||||
def __eq__(self, other: Any) -> bool: ...
|
||||
def __init__(
|
||||
self,
|
||||
requester: Requester,
|
||||
headers: Dict[str, Union[str, int]],
|
||||
attributes: Dict[str, Any],
|
||||
completed: bool,
|
||||
) -> None: ...
|
||||
def __ne__(self, other: Any) -> bool: ...
|
||||
def _completeIfNeeded(self) -> None: ...
|
||||
def _completeIfNotSet(
|
||||
self, value: Union[_ValuedAttribute, _BadAttribute, _NotSetType]
|
||||
) -> None: ...
|
||||
def update(self) -> bool: ...
|
||||
|
||||
class GithubObject:
|
||||
def __init__(
|
||||
self,
|
||||
requester: Optional[Requester],
|
||||
headers: Dict[str, Union[str, int]],
|
||||
attributes: Any,
|
||||
completed: bool,
|
||||
) -> None: ...
|
||||
@staticmethod
|
||||
def _makeBoolAttribute(value: Optional[bool]) -> _ValuedAttribute: ...
|
||||
def _makeClassAttribute(
|
||||
self, klass: Any, value: Any
|
||||
) -> Union[_ValuedAttribute, _BadAttribute]: ...
|
||||
@staticmethod
|
||||
def _makeDatetimeAttribute(
|
||||
value: Optional[Union[int, str]]
|
||||
) -> Union[_ValuedAttribute, _BadAttribute]: ...
|
||||
@staticmethod
|
||||
def _makeDictAttribute(value: Dict[str, Any]) -> _ValuedAttribute: ...
|
||||
def _makeDictOfStringsToClassesAttribute(
|
||||
self,
|
||||
klass: Type[GistFile],
|
||||
value: Dict[
|
||||
str,
|
||||
Union[int, Dict[str, Union[str, int, None]], Dict[str, Union[str, int]]],
|
||||
],
|
||||
) -> Union[_ValuedAttribute, _BadAttribute]: ...
|
||||
@staticmethod
|
||||
def _makeIntAttribute(
|
||||
value: Optional[Union[int, str]]
|
||||
) -> Union[_ValuedAttribute, _BadAttribute]: ...
|
||||
def _makeListOfClassesAttribute(
|
||||
self, klass: Any, value: Any
|
||||
) -> Union[_ValuedAttribute, _BadAttribute]: ...
|
||||
@staticmethod
|
||||
def _makeListOfDictsAttribute(
|
||||
value: List[Dict[str, Union[str, List[Dict[str, Union[str, List[int]]]]]]]
|
||||
) -> _ValuedAttribute: ...
|
||||
@staticmethod
|
||||
def _makeListOfIntsAttribute(value: List[int]) -> _ValuedAttribute: ...
|
||||
@staticmethod
|
||||
def _makeListOfListOfStringsAttribute(
|
||||
value: List[List[str]],
|
||||
) -> _ValuedAttribute: ...
|
||||
@staticmethod
|
||||
def _makeListOfStringsAttribute(
|
||||
value: Union[List[List[str]], List[str], List[Union[str, int]]]
|
||||
) -> Union[_ValuedAttribute, _BadAttribute]: ...
|
||||
@staticmethod
|
||||
def __makeSimpleAttribute(
|
||||
value: Any, type: type
|
||||
) -> Union[_ValuedAttribute, _BadAttribute]: ...
|
||||
@staticmethod
|
||||
def __makeSimpleListAttribute(
|
||||
value: list, type: type
|
||||
) -> Union[_ValuedAttribute, _BadAttribute]: ...
|
||||
@staticmethod
|
||||
def __makeTransformedAttribute(
|
||||
value: Any, type: type, transform: Callable[..., Any]
|
||||
) -> Union[_ValuedAttribute, _BadAttribute]: ...
|
||||
@staticmethod
|
||||
def _makeStringAttribute(
|
||||
value: Optional[Union[int, str]]
|
||||
) -> Union[_ValuedAttribute, _BadAttribute]: ...
|
||||
@staticmethod
|
||||
def _makeTimestampAttribute(value: int) -> _ValuedAttribute: ...
|
||||
@staticmethod
|
||||
def _parentUrl(url: str) -> str: ...
|
||||
def _storeAndUseAttributes(
|
||||
self, headers: Dict[str, Union[str, int]], attributes: Any
|
||||
) -> None: ...
|
||||
@property
|
||||
def etag(self) -> Optional[str]: ...
|
||||
def get__repr__(self, params: Dict[str, Any]) -> str: ...
|
||||
@property
|
||||
def last_modified(self) -> Optional[str]: ...
|
||||
@property
|
||||
def raw_data(self) -> Dict[str, Any]: ...
|
||||
@property
|
||||
def raw_headers(self) -> Dict[str, Union[str, int]]: ...
|
||||
@classmethod
|
||||
def setCheckAfterInitFlag(cls, flag: bool) -> None: ...
|
||||
|
||||
class NonCompletableGithubObject:
|
||||
def _completeIfNeeded(self) -> None: ...
|
||||
|
||||
class _BadAttribute:
|
||||
def __init__(
|
||||
self, value: Any, expectedType: Any, exception: Optional[ValueError] = ...
|
||||
) -> None: ...
|
||||
@property
|
||||
def value(self): ...
|
||||
|
||||
class _NotSetType:
|
||||
def __repr__(self) -> str: ...
|
||||
|
||||
class _ValuedAttribute:
|
||||
def __init__(self, value: Any) -> None: ...
|
||||
Reference in New Issue
Block a user