Typed interactions with the GitHub API v3
LGPL-3.0 License
Bot releases are hidden (Show)
Published by EnricoMi 9 months ago
The github.Comparison.Comparison
instance returned by Repository.compare
provides a commits
property that used to return a list[github.Commit.Commit]
, which has now been changed to PaginatedList[github.Commit.Commit]
. This breaks user code that assumes a list
:
commits = repo.compare("v0.6", "v0.7").commits
no_of_commits = len(commits) # will raise a TypeError
This will raise a TypeError: object of type 'PaginatedList' has no len()
, as the returned PaginatedList
does not support the len()
method. Use the totalCount
property instead:
commits = repo.compare("v0.6", "v0.7").commits
no_of_commits = commits.totalCount
Repository.compare().commits
return paginated list by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/2882
include_all_branches
to create_repo_from_template
of AuthenticatedUser
and Organization
by @janssonoskar in https://github.com/PyGithub/PyGithub/pull/2871
Organization.create_repo
by @tekumara in https://github.com/PyGithub/PyGithub/pull/2700
Repository
collaborator permissions by @flying-sheep in https://github.com/PyGithub/PyGithub/pull/1996
PullRequestReview.dismiss
by @ColasGael in https://github.com/PyGithub/PyGithub/pull/2854
request_cve
on RepositoryAdvisories
by @JLLeitschuh in https://github.com/PyGithub/PyGithub/pull/2855
GithubObject.last_modified_datetime
to have last_modified
as a datetime
by @chouetz in https://github.com/PyGithub/PyGithub/pull/2772
internal
as valid Repository visibility value by @AndrewJDawes in https://github.com/PyGithub/PyGithub/pull/2806
Repository
by @trim21 in https://github.com/PyGithub/PyGithub/pull/2798
Full Changelog: https://github.com/PyGithub/PyGithub/compare/v2.1.1...v2.2.0
Published by EnricoMi about 1 year ago
Published by EnricoMi about 1 year ago
This release introduces a default throttling mechanism to mitigate secondary rate limit errors and comply with Github's best practices:
https://docs.github.com/en/rest/guides/best-practices-for-integrators?apiVersion=2022-11-28#dealing-with-secondary-rate-limits
The default throttling of 1 second between writes and 0.25 second between any requests can be configured
for github.Github
and github.GithubIntegration
:
g = github.Github(seconds_between_requests=0.25, seconds_between_writes=1)
Set these parameters to None
to disable throttling and restore earlier behavior.
This release introduces a default retry mechanism to retry retry-able 403 responses (primary and secondary rate limit errors only) and any 5xx response.
Class github.GithubRetry
implements this behavior, and can be configured via the retry
argument of github.Github
and github.GithubIntegration
.
Retry behavior is configured similar to urllib3.Retry
: https://urllib3.readthedocs.io/en/stable/reference/urllib3.util.html
g = github.Github(retry=github.GithubRetry())
Set this parameter to None
to disable retry mechanism and restore earlier behaviour.
Any timestamps returned by this library are datetime
with timezone information, usually UTC.
Before this release, timestamps used to be naive datetime
instances without timezone.
Comparing (other than ==
) these timestamps with naive datetime
instances used to work but will now break.
Add a timezone information to your datetime
instances before comparison:
if g.get_repo("PyGithub/PyGithub").created_at < datetime(2012, 2, 26, tzinfo=timezone.utc):
...
A Netrc file (e.g. ~/.netrc
) does not override PyGithub authentication, anymore.
If you require authentication through Netrc, then this is a breaking change.
Use a github.Auth.Netrc
instance to use Netrc credentials:
>>> auth = Auth.Netrc()
>>> g = Github(auth=auth)
>>> g.get_user().login
'login'
Merged overloaded create_pull
methods
def create_pull(self, issue, base, head)
def create_pull(self, title, body, base, head, maintainer_can_modify=NotSet, draft=False)
into
def create_pull(self, base, head, *, title=NotSet, body=NotSet, maintainer_can_modify=NotSet, draft=NotSet, issue=NotSet)
Please update your usage of Repository.create_pull
accordingly.
Branch.edit_*
functions return objects (#2748) (8dee53a8)license
attribute to Repository
(#2721) (26d353e7)Repository
(#2742) (65cfeb1b)is_alphanumeric
attribute to Autolink
and Repository.create_autolink
(#2630) (b6a28a26)requests
fallback to netrc, provide github.Auth.Netrc
(#2739) (ac36f6a9)AppInstallationAuth.__integration
(#2695) (8bf542ae)Secret
and Variable
classes (#2623) (bcca758d)required_linear_history
attribute to BranchProtection
(#2643) (7a80fad9)GithubException
, don't log it (#2611) (de80ff4b)message
property to GithubException
(#2591) (f087cad3)Workflow.get_runs()
(#2346) (766df993)github.Rate.used
field (#2531) (c4c2e527)Branch.bypass_pull_request_allowances
failing with "nil is not an object" (#2535) (c5542a6a)required_conversation_resolution
assertion (#2715) (54f22267)responseHeaders
to int
(#2697) (adbfce92)subject_type
in creating pull request review comment (#2642) (4933459e)GithubRetry.py
(#2610) (950a6949)Branch.bypass_pull_request_allowances
failing with "nil is not an object" (#2535) (c5542a6a).pyi
type stubs back to .py
sources (#2636)add_attribute.py
to latest conding style (#2631) (e735972e)flake8
with ruff
(#2617) (42c3b47c)disallow_untyped_defs
(#2609) (294c0cc9)check_untyped_defs
(#2607) (8816889a)typing_extensions
for TypedDict
(#2592) (5fcb0c7d)flake8
as last (#2595) (11bb6bd7)Published by EnricoMi about 1 year ago
Published by EnricoMi about 1 year ago
Published by EnricoMi over 1 year ago
Published by EnricoMi over 1 year ago
Published by sfdye almost 2 years ago
Breaking Changes
Bug Fixes & Improvements
run_started_at
& run_attempt
), remove deprecated unicode
type (#2273) (3a6235b5)Important
This is the last release that will support Python 3.6.
Bug Fixes & Improvements
html_url
property in Team Class. (#1983) (6570892a)Breaking Changes
Bug Fixes & Improvements
Important
This is the last release that will support Python 3.5.
Breaking Changes
The Github.get_installation(integer) method has been removed.
Repository.create_deployment()'s payload parameter is now a dictionary.
Bug Fixes & Improvements
Installation.id
(#1743) (546f6495)Repository.get_workflow_runs
parameters (#1682) (c23564dd)Repository.create_git_tag_and_release()
StatsPunchCard
. (#1520) (ce400bc7)New features
Bug Fixes & Improvements
Bug Fixes & Improvements
Important
Python 2 support has been removed. If you still require Python 2, use 1.45.
Bug Fixes & Improvements
Important
Breaking Changes
Bug Fixes & Improvements