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

Update dependency PyGithub to v2 #690

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate-rancher[bot]
Copy link
Contributor

@renovate-rancher renovate-rancher bot commented Aug 3, 2024

This PR contains the following updates:

Package Update Change
PyGithub major ==1.59.1 -> ==2.5.0

Release Notes

pygithub/pygithub (PyGithub)

v2.5.0

Compare Source

Breaking Changes

  • Parameters of method github.Requester.Requester.graphql_named_mutation have been renamed:
    • Parameter variables renamed to mutation_input
    • Parameter output renamed to output_schema
    • Default value of parameter output has been removed

New features

Improvements

Bug Fixes

Maintenance

v2.4.0

Compare Source

New features

Improvements

Bug Fixes

Maintenance

v2.3.0

Compare Source

New features

Improvements

Bug Fixes

Maintenance

v2.2.0

Compare Source

Breaking Changes

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

New features

  • Add support to call GraphQL API

Improvements

Bug Fixes

Maintenance

Full Changelog: PyGithub/PyGithub@v2.1.1...v2.2.0

v2.1.1

Compare Source

Bug Fixes

Maintenance

v2.1.0.post0

Compare Source

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.NetrcAuth instance to use Netrc credentials:

>>> auth = Auth.NetrcAuth()
>>> 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

Improvements

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 to int (#​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


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@renovate-rancher renovate-rancher bot requested a review from a team as a code owner August 3, 2024 04:47
@renovate-rancher renovate-rancher bot changed the title Update dependency PyGithub to v2 chore(deps): update dependency pygithub to v2 Sep 24, 2024
@renovate-rancher renovate-rancher bot changed the title chore(deps): update dependency pygithub to v2 Update dependency PyGithub to v2 Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants