The notion of lazy objects has been added to some PyGithub classes in version 2.6.0. This release now makes all CompletableGithubObjects optionally lazy (if useful). See PyGithub/PyGithub#3403 for a complete list.
In lazy mode, getting a PyGithub object does not send a request to the GitHub API. Only accessing methods and properties sends the necessary requests to the GitHub API:
# Use lazy modeg=Github(auth=auth, lazy=True)
# these method calls do not send requests to the GitHub APIuser=g.get_user("PyGithub") # get the userrepo=user.get_repo("PyGithub") # get the user's repopull=repo.get_pull(3403) # get a known pull requestissue=pull.as_issue() # turn the pull request into an issue# these method and property calls send requests to Github APIissue.create_reaction("rocket") # create a reactioncreated=repo.created_at# get property of lazy object repo# once a lazy object has been fetched, all properties are available (no more requests)licence=repo.license
All PyGithub classes that implement CompletableGithubObject support lazy mode (if useful). This is only useful for classes that have methods creating, changing, or getting objects.
By default, PyGithub objects are not lazy.
PyGithub objects with a paginated property
The GitHub API has the "feature" of paginated properties. Some objects returned by the API have a property that allows for pagination. Fetching subsequent pages of that property means fetching the entire object (with all other properties) and the specified page of the paginated property. Iterating over the paginated property means fetching all other properties multiple times. Fortunately, the allowed size of each page (per_page is usually 300, in contrast to the "usual" per_page maximum of 100).
Objects with paginated properties:
Commit.files
Comparison.commits
EnterpriseConsumedLicenses.users
This PR makes iterating those paginated properties use the configured per_page setting.
It further allows to specify an individual per_page when either retrieving such objects, or fetching paginated properties.
Python 3.8 reached its end-of-life September 6, 2024. Support has been removed with this release.
Deprecations
Method delete of Reaction is deprecated, use IssueComment.delete_reaction,
PullRequestComment.delete_reaction, CommitComment.delete_reaction or Issue.delete_reaction instead.
Method Issue.assignee and parameter Issue.edit(assignee=…) are deprecated,
use Issue.assignees and Issue.edit(assignees=…) instead.
Method Organization.edit_hook is deprecated, use Organization.get_hook(id).edit(…) instead.
If you need to avoid Organization.get_hook(id) to fetch the Hook object from Github API,
use a lazy Github instance:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
Release Notes
pygithub/pygithub (PyGithub)v2.9.0
Compare Source
Notable changes
Lazy PyGithub objects
The notion of lazy objects has been added to some PyGithub classes in version 2.6.0. This release now makes all CompletableGithubObjects optionally lazy (if useful). See PyGithub/PyGithub#3403 for a complete list.
In lazy mode, getting a PyGithub object does not send a request to the GitHub API. Only accessing methods and properties sends the necessary requests to the GitHub API:
All PyGithub classes that implement CompletableGithubObject support lazy mode (if useful). This is only useful for classes that have methods creating, changing, or getting objects.
By default, PyGithub objects are not lazy.
PyGithub objects with a paginated property
The GitHub API has the "feature" of paginated properties. Some objects returned by the API have a property that allows for pagination. Fetching subsequent pages of that property means fetching the entire object (with all other properties) and the specified page of the paginated property. Iterating over the paginated property means fetching all other properties multiple times. Fortunately, the allowed size of each page (per_page is usually 300, in contrast to the "usual" per_page maximum of 100).
Objects with paginated properties:
This PR makes iterating those paginated properties use the configured per_page setting.
It further allows to specify an individual per_page when either retrieving such objects, or fetching paginated properties.
See Classes with paginated properties for details.
Drop Python 3.8 support due to End-of-Life
Python 3.8 reached its end-of-life September 6, 2024. Support has been removed with this release.
Deprecations
PullRequestComment.delete_reaction, CommitComment.delete_reaction or Issue.delete_reaction instead.
use Issue.assignees and Issue.edit(assignees=…) instead.
If you need to avoid Organization.get_hook(id) to fetch the Hook object from Github API,
use a lazy Github instance:
use Team.add_membership or Team.remove_membership instead.
New Features
Improvements
Bug Fixes
Maintenance
New Contributors
Full Changelog: PyGithub/PyGithub@v2.8.0...v2.9.0
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 these updates again.
This PR was generated by Mend Renovate. View the repository job log.