pypi / pygithub
pygithub
What changed in pygithub 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-21.
3 breaking1 security6 deprecations15 new APIs and options13 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpygithub 238 changes
Breaking changes 3
PyGithub adds support for Python 3.15.
Support for Python 3.9 has been removed because it reached end-of-life.
Support for Python 3.8 has been removed because the Python version reached end-of-life.
Security 1
Fixes a duplicated URL; editing now seals the value and uses PUT.
Deprecations 6
Issue.assignee is deprecated; use Issue.assignees instead.
The assignee parameter is deprecated; use assignees instead.
Organization.edit_hook is deprecated; use Organization.get_hook(id).edit(...) instead. A lazy Github instance can avoid fetching the Hook object first.
Reaction.delete is deprecated; use the corresponding delete_reaction method on IssueComment, PullRequestComment, CommitComment, or Issue instead.
Team.add_to_members is deprecated; use Team.add_membership instead.
Team.remove_from_members is deprecated; use Team.remove_membership instead.
New APIs and options 15
Allows creating a custom property with the values_editable_by parameter.
The GitHub API version can now be specified.
Adds max_rate_limit_wait to cap rate limit backoff.
Issue dependency endpoints are now available.
Adds the incomplete_results property to PaginatedList.
Pull request creation now supports head_repo.
Adds Repository.get_workflow_job.
Adds the return_run_details parameter.
Adds WorkflowRun.get_attempt.
Code Scan Alerts support was improved.
get_issues now supports the type parameter.
Github instances can be created with lazy=True; object retrieval avoids API requests until methods or properties need the data. Lazy mode is off by default.
An individual per_page value can be specified when retrieving objects with paginated properties or fetching those properties.
Support for Secret Scanning Alerts was added.
A throw option was added to Workflow.create_dispatch to raise exceptions.
Fixes and other changes 13
Fixes a doubled slash in request paths when base_url has a trailing slash.
Boolean query parameters are now encoded as lowercase.
Fixes decoding of bytes data when converting GithubException to a string.
Fixes lazy retrieval of the latest tag name.
Fixes handling of the state and code_verifier parameters.
Fixes a duplicated URL in OrganizationVariable.edit.
Fixes OrganizationVariable.value by using the base class properly.
Parses only the query string when determining totalCount.
Fixed getting a release by tag in lazy mode.
Enterprise base URLs prefixed with api. are now allowed.
A default type is now used when a known type is unsupported.
Fixed totalCount returning 0 when GitHub deprecation notices are present.
Iterating paginated properties now uses the configured per_page setting.