Sync GithubIntegration __init__ arguments with github.Github (#2556)

Github and GithubIntegration now both support the same (full) set of Requester arguments.
Creating a Github instance for a Github App Installation coming from GithubIntegration uses the same
Requester arguments (except for auth).
This commit is contained in:
Enrico Minack
2023-06-21 09:04:19 +02:00
committed by GitHub
parent f4e9dcb341
commit ea45237d3b
16 changed files with 333 additions and 27 deletions
+4 -1
View File
@@ -83,6 +83,7 @@ class Github:
This is the main class you instantiate to access the Github API v3. Optional parameters allow different authentication methods.
"""
# keep non-deprecated arguments in-sync with Requester
# v2: remove login_or_token, password, jwt and app_auth
# v2: move auth to the front of arguments
# v2: add * before first argument so all arguments must be named,
@@ -95,7 +96,7 @@ class Github:
app_auth=None,
base_url=Consts.DEFAULT_BASE_URL,
timeout=Consts.DEFAULT_TIMEOUT,
user_agent="PyGithub/Python",
user_agent=Consts.DEFAULT_USER_AGENT,
per_page=Consts.DEFAULT_PER_PAGE,
verify=True,
retry=None,
@@ -123,6 +124,8 @@ class Github:
assert isinstance(base_url, str), base_url
assert isinstance(timeout, int), timeout
assert user_agent is None or isinstance(user_agent, str), user_agent
assert isinstance(per_page, int), per_page
assert isinstance(verify, (bool, str)), verify
assert (
retry is None
or isinstance(retry, int)