Files
PyGithub/github/Commit.pyi
T
Emily 6eba4506d4 Improve type stubs (#1489)
* Add type stubs for GithubException subclasses

* Install type stubs per PEP 561

See https://mypy.readthedocs.io/en/stable/installed_packages.html#making-pep-561-compatible-packages.

* Make PaginatedList a generic type

* Add type stubs for __init__.py

* Add type stub for NamedUser.get_projects

* Add GithubObject superclasses to type stubs

Fixes #1490
2020-05-01 12:00:00 +10:00

56 lines
1.8 KiB
Python

from typing import Any, Dict, List, Union
from github.CommitCombinedStatus import CommitCombinedStatus
from github.CommitComment import CommitComment
from github.CommitStats import CommitStats
from github.CommitStatus import CommitStatus
from github.File import File
from github.GitCommit import GitCommit
from github.GithubObject import CompletableGithubObject, _NotSetType
from github.NamedUser import NamedUser
from github.PaginatedList import PaginatedList
class Commit(CompletableGithubObject):
def __repr__(self) -> str: ...
@property
def _identity(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def author(self) -> NamedUser: ...
@property
def comments_url(self) -> str: ...
@property
def commit(self) -> GitCommit: ...
@property
def committer(self) -> NamedUser: ...
def create_comment(
self,
body: str,
line: Union[int, _NotSetType] = ...,
path: Union[_NotSetType, str] = ...,
position: Union[int, _NotSetType] = ...,
) -> CommitComment: ...
def create_status(
self,
state: str,
target_url: Union[_NotSetType, str] = ...,
description: Union[_NotSetType, str] = ...,
context: Union[_NotSetType, str] = ...,
) -> CommitStatus: ...
@property
def files(self) -> List[File]: ...
def get_combined_status(self) -> CommitCombinedStatus: ...
def get_comments(self) -> PaginatedList[GitCommit]: ...
def get_statuses(self) -> PaginatedList[CommitStatus]: ...
@property
def html_url(self) -> str: ...
@property
def parents(self) -> List[Commit]: ...
@property
def sha(self) -> str: ...
@property
def stats(self) -> CommitStats: ...
@property
def url(self) -> str: ...