Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI #2330

Merged
merged 3 commits into from
Oct 13, 2022
Merged

Fix CI #2330

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@

# Add pyupgrade to pre-commit
e113e37de1ec687c68337d777f3629251b35ab28

Run pre-commit autoupdate and run all hooks
sfdye marked this conversation as resolved.
Show resolved Hide resolved
4c24c73d34b54a061b0c800eeea64dc64c230a63
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
repos:
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.4
rev: v2.2.0
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
rev: v5.10.1
hooks:
- id: isort
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
rev: 3.9.2
hooks:
- id: flake8
- repo: https://github.com/codespell-project/codespell
rev: v1.16.0
rev: v2.2.1
hooks:
- id: codespell
exclude: tests/
args:
- --ignore-words-list="bloaded,nto,pullrequest,pullrequests,thi,tim,wan,Wan,chang,Chang"
- --quiet-level=2
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.4
rev: v3.1.0
hooks:
- id: pyupgrade
args:
Expand Down
2 changes: 1 addition & 1 deletion github/AccessToken.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AccessToken(github.GithubObject.NonCompletableGithubObject):
def __repr__(self):
return self.get__repr__(
{
"token": "{}...".format(self.token[:5]),
"token": f"{self.token[:5]}...",
"scope": self.scope,
"type": self.type,
}
Expand Down
11 changes: 2 additions & 9 deletions github/ApplicationOAuth.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ class ApplicationOAuth(NonCompletableGithubObject):
@property
def client_secret(self) -> str: ...
def get_login_url(
self,
redirect_uri: Optional[str],
state: Optional[str],
login: Optional[str]
self, redirect_uri: Optional[str], state: Optional[str], login: Optional[str]
) -> str: ...
def get_access_token(
self,
code: str,
state: Optional[str]
) -> AccessToken: ...
def get_access_token(self, code: str, state: Optional[str]) -> AccessToken: ...
1 change: 0 additions & 1 deletion github/DeploymentStatus.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ from typing import Any, Dict
from github.GithubObject import CompletableGithubObject
from github.NamedUser import NamedUser


class DeploymentStatus(CompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
Expand Down
2 changes: 0 additions & 2 deletions github/GithubApp.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

from typing import Any, Dict, List

from datetime import datetime
from github.GithubObject import CompletableGithubObject
from github.NamedUser import NamedUser


class GithubApp(CompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
Expand Down
2 changes: 1 addition & 1 deletion github/GithubException.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def headers(self):
return self.__headers

def __str__(self):
return "{status} {data}".format(status=self.status, data=json.dumps(self.data))
return f"{self.status} {json.dumps(self.data)}"


class BadCredentialsException(GithubException):
Expand Down
5 changes: 3 additions & 2 deletions github/GithubException.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from typing import Any, Dict, List, Optional, Tuple, Type, Union

class GithubException(Exception):
def __init__(self, status: Union[int, str], data: Any, headers: Optional[Dict[str, str]]) -> None: ...
def __init__(
self, status: Union[int, str], data: Any, headers: Optional[Dict[str, str]]
) -> None: ...
def __str__(self) -> str: ...
@property
def data(self) -> Dict[str, Union[str, List[str], List[Dict[str, str]]]]: ...
@property
def status(self) -> int: ...

@property
def headers(self) -> Union[None, Dict[str, str]]: ...

Expand Down
8 changes: 2 additions & 6 deletions github/MainClass.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ from github.Topic import Topic

# from urllib3.util.retry import Retry

TGithubObject = TypeVar('TGithubObject', bound=GithubObject)
TGithubObject = TypeVar("TGithubObject", bound=GithubObject)

class Github:
def __init__(
Expand Down Expand Up @@ -130,11 +130,7 @@ class Github:
order: Union[str, _NotSetType] = ...,
**qualifiers: Any
) -> PaginatedList[Repository]: ...
def search_topics(
self,
query: str,
**qualifiers: Any
) -> PaginatedList[Topic]: ...
def search_topics(self, query: str, **qualifiers: Any) -> PaginatedList[Topic]: ...
def search_users(
self,
query: str,
Expand Down
1 change: 0 additions & 1 deletion github/Organization.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,3 @@ class Organization(CompletableGithubObject):
def updated_at(self) -> datetime: ...
@property
def url(self) -> str: ...

1 change: 1 addition & 0 deletions github/PaginatedList.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class PaginatedListBase(Generic[T]):
def __iter__(self) -> Iterator[T]: ...
def _grow(self) -> Any: ...
def _isBiggerThan(self, index: int) -> bool: ...

class _Slice:
def __init__(self, theList: PaginatedList[T], theSlice: slice) -> None: ...
def __iter__(self) -> Iterator[T]: ...
Expand Down
1 change: 0 additions & 1 deletion github/ProjectColumn.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ class ProjectColumn(CompletableGithubObject):
def move(self, position: str) -> bool: ...
def delete(self) -> bool: ...
def edit(self, name: str) -> None: ...

4 changes: 1 addition & 3 deletions github/Repository.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,7 @@ class Repository(CompletableGithubObject):
) -> str: ...
def get_assignees(self) -> PaginatedList[NamedUser]: ...
def get_branch(self, branch: str) -> Branch: ...
def rename_branch(
self, branch: Union[str, Branch], new_name: str
) -> bool: ...
def rename_branch(self, branch: Union[str, Branch], new_name: str) -> bool: ...
def get_branches(self) -> PaginatedList[Branch]: ...
def get_check_run(self, check_run_id: int) -> CheckRun: ...
def get_check_suite(self, check_suite_id: int) -> CheckSuite: ...
Expand Down
2 changes: 1 addition & 1 deletion github/Requester.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def __init__(
if password is not None:
login = login_or_token
b64 = (
base64.b64encode((f"{login}:{password}").encode("utf-8"))
base64.b64encode((f"{login}:{password}").encode())
.decode("utf-8")
.replace("\n", "")
)
Expand Down
24 changes: 19 additions & 5 deletions github/Requester.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,34 @@ class Requester:
) -> None: ...
def NEW_DEBUG_FRAME(self, requestHeader: Dict[str, str]) -> None: ...
def __check(
self, status: int, responseHeader: Dict[str, Any], output: str,
self,
status: int,
responseHeader: Dict[str, Any],
output: str,
) -> Tuple[Dict[str, Any], Dict[str, Any]]: ...
def __addParametersToUrl(self, url: str, parameters: Dict[str, Any],) -> str: ...
def __addParametersToUrl(
self,
url: str,
parameters: Dict[str, Any],
) -> str: ...
def __authenticate(
self, url: str, responseHeader: Dict[str, Any], parameters: Dict[str, Any],
self,
url: str,
responseHeader: Dict[str, Any],
parameters: Dict[str, Any],
) -> None: ...
def __customConnection(
self, url: str,
self,
url: str,
) -> Optional[Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]]: ...
def __createConnection(
self,
) -> Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]: ...
def __createException(
self, status: int, headers: Dict[str, Any], output: str,
self,
status: int,
headers: Dict[str, Any],
output: str,
) -> Any: ...
def __log(
self,
Expand Down
1 change: 1 addition & 0 deletions github/StatsContributor.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class StatsContributor(NonCompletableGithubObject):
def total(self) -> int: ...
@property
def weeks(self) -> List[Week]: ...

class Week(NonCompletableGithubObject):
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, int]) -> None: ...
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ pynacl>=1.4.0
requests>=2.14.0
pyjwt>=2.0
sphinx<3
Jinja2<3.1
sphinx-rtd-theme<1.1
Deprecated
4 changes: 2 additions & 2 deletions tests/PaginatedList.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ def testCustomPerPage(self):
self.assertEqual(len(list(self.repo.get_issues())), 456)

def testCustomPerPageWithNoUrlParams(self):
from . import (
from . import ( # Don't polute github.tests namespace, it would conflict with github.tests.CommitComment
CommitComment,
) # Don't polute github.tests namespace, it would conflict with github.tests.CommitComment
)

self.g.per_page = 100
PaginatedListImpl(
Expand Down