diff --git a/github/MainClass.py b/github/MainClass.py index d27d634b..400ad8bb 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -257,7 +257,7 @@ class Github(object): """ :calls: `GET /users/:user `_ or `GET /user `_ :param login: string - :rtype: :class:`github.NamedUser.NamedUser` + :rtype: :class:`github.NamedUser.NamedUser` or :class:`github.AuthenticatedUser.AuthenticatedUser` """ assert login is github.GithubObject.NotSet or isinstance(login, str), login if login is github.GithubObject.NotSet: diff --git a/github/MainClass.pyi b/github/MainClass.pyi index dd986fd2..46ff17de 100644 --- a/github/MainClass.pyi +++ b/github/MainClass.pyi @@ -1,6 +1,6 @@ from datetime import datetime from io import BytesIO -from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Union +from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Union, overload from github.AuthenticatedUser import AuthenticatedUser from github.Commit import Commit @@ -79,9 +79,10 @@ class Github: since: Union[int, _NotSetType] = ..., visibility: Union[str, _NotSetType] = ..., ) -> PaginatedList[Repository]: ... - def get_user( - self, login: Union[str, _NotSetType] = ... - ) -> Union[AuthenticatedUser, NamedUser]: ... + @overload + def get_user(self, login: _NotSetType) -> AuthenticatedUser: ... + @overload + def get_user(self, login: str) -> NamedUser: ... def get_users( self, since: Union[int, _NotSetType] = ... ) -> PaginatedList[NamedUser]: ... diff --git a/github/ProjectColumn.py b/github/ProjectColumn.py index 7792867d..33217eed 100644 --- a/github/ProjectColumn.py +++ b/github/ProjectColumn.py @@ -126,6 +126,7 @@ class ProjectColumn(github.GithubObject.CompletableGithubObject): :param note: string :param content_id: integer :param content_type: string + :rtype :class:`github.ProjectCard.ProjectCard`: """ if isinstance(note, str): @@ -150,6 +151,7 @@ class ProjectColumn(github.GithubObject.CompletableGithubObject): """ :calls: `POST POST /projects/columns/:column_id/moves `_ :param position: string + :rtype: bool """ assert isinstance(position, str), position @@ -164,7 +166,7 @@ class ProjectColumn(github.GithubObject.CompletableGithubObject): def delete(self): """ - :calls: `DELETE /projects/columns/:column_id `_ :rtype: bool """ status, _, _ = self._requester.requestJson( diff --git a/github/Repository.py b/github/Repository.py index 7d69720f..c84f54ac 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -2924,7 +2924,7 @@ class Repository(github.GithubObject.CompletableGithubObject): def get_releases(self): """ - :calls: `GET /repos/:owner/:repo/releases `_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.GitRelease.GitRelease` """ return github.PaginatedList.PaginatedList( diff --git a/requirements.txt b/requirements.txt index 1b32257d..4ff3518d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ requests>=2.14.0 pyjwt -sphinx +sphinx<3 sphinx-rtd-theme<0.5 Deprecated