chore(deps): update dependency pygithub to v2
This MR contains the following updates:
Package | Change | Age | Adoption | Passing | Confidence |
---|---|---|---|---|---|
pygithub |
==1.59.1 -> ==2.1.1
|
Release Notes
pygithub/pygithub
v2.1.1
Bug Fixes
Maintenance
v2.1.0.post0
Important
Request throttling
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.
Request retry
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.
Breaking Changes
Timestamps
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):
...
Netrc authentication
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'
Repository.create_pull
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.
New features
- Throttle requests to mitigate RateLimitExceededExceptions (#2145) (
9915580
) - Retry retryable 403 (rate limit) (#2387) (
0bb72ca
) - Close connections after use (#2724) (
73236e2
)
Improvements
- Make datetime objects timezone-aware (#2565) (
0177f7c
) - Make
Branch.edit_*
functions return objects (#2748) (8dee53a
) - Add
license
attribute toRepository
(#2721) (26d353e
) - Add missing attributes to
Repository
(#2742) (65cfeb1
) - Add
is_alphanumeric
attribute toAutolink
andRepository.create_autolink
(#2630) (b6a28a2
) - Suppress
requests
fallback to netrc, providegithub.Auth.Netrc
(#2739) (ac36f6a
) - Pass Requester arguments to
AppInstallationAuth.__integration
(#2695) (8bf542a
) - Adding feature for enterprise consumed license (#2626) (
a7bfdf2
) - Search Workflows by Name (#2711) (
eadc241
) - Add
Secret
andVariable
classes (#2623) (bcca758
) - Add Autolink API link (#2632) (
aedfa0b
) - Add
required_linear_history
attribute toBranchProtection
(#2643) (7a80fad
) - Add retry issue to
GithubException
, don't log it (#2611) (de80ff4
) - Add
message
property toGithubException
(#2591) (f087cad
) - Add support for repo and org level actions variables (#2580) (
91b3f40
) - Add missing arguments to
Workflow.get_runs()
(#2346) (766df99
) - Add
github.Rate.used
field (#2531) (c4c2e52
)
Bug Fixes
- Fix
Branch.bypass_pull_request_allowances
failing with "nil is not an object" (#2535) (c5542a6
) - Fix
required_conversation_resolution
assertion (#2715) (54f2226
) - Fix assertion creating pull request review comment (#2641) (
2fa568b
) - Safely coerce
responseHeaders
toint
(#2697) (adbfce9
) - Fix assertion for
subject_type
in creating pull request review comment (#2642) (4933459
) - Use timezone-aware reset datetime in
GithubRetry.py
(#2610) (950a694
) - Fix
Branch.bypass_pull_request_allowances
failing with "nil is not an object" (#2535) (c5542a6
)
Maintenance
- Epic mass-merge
.pyi
type stubs back to.py
sources (#2636) - Move to main default branch (#2566) (
e66c163
) - Force Unix EOL (#2573) (
094538e
) - Close replay test data file silently when test is failing already (#2747) (
6d871d5
) - CI: Make CI support merge queue (#2644) (
a91debf
) - CI: Run CI on release branches (#2708) (
9a88b6b
) - CI: remove conflict label workflow (#2669) (
95d8b83
) - Fix pip install command in README.md (#2731) (
2cc1ba2
) - Update
add_attribute.py
to latest conding style (#2631) (e735972
) - CI: Improve ruff DX (#2667) (
48d2009
) - CI: Increase wait and retries of labels action (#2670) (
ff0f31c
) - Replace
flake8
withruff
(#2617) (42c3b47
) - CI: update labels action name and version (#2654) (
c5c83eb
) - CI: label MRs that have conflicts (#2622) (
1d637e4
) - Unify requirements files location & source in setup.py (#2598) (
2edc0f8
) - Enable mypy
disallow_untyped_defs
(#2609) (294c0cc
) - Enable mypy
check_untyped_defs
(#2607) (8816889
) - Set line length to 120 characters (#2599) (
13e178a
) - CI: Build and check package before release (#2593) (
3c880e7
) - Use
typing_extensions
forTypedDict
(#2592) (5fcb0c7
) - CI: Update action actions/setup-python (#2382) (
2e5cd31
) - Add more methods and attributes to Repository.pyi (#2581) (
72840de
) - CI: Make pytest color logs (#2597) (
7324110
) - precommit: move
flake8
as last (#2595) (11bb6bd
) - Test on Windows and macOS, don't fail fast (#2590) (
5c60089
) - Remove symlinks from test data (#2588) (
8d3b905
)
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.