v1.59.0
Important
This release introduces new way of authentication. All authentication-related arguments github.Github(login_or_token=…, password=…, jwt=…, app_auth=…)
and github.GithubIntegration(integration_id=…, private_key=…, jwt_expiry=…, jwt_issued_at=…, jwt_algorithm=…)
are replaced by a single auth=…
argument. Module github.Auth
provides classes for all supported ways of authentication: Login
, Token
, AppAuth
, AppAuthToken
, AppInstallationAuth
, AppUserAuth
. Old arguments are deprecated but continue to work. They are scheduled for removal for version 2.0 release.
This project has decided to move all typing information from .pyi
files into the respective .py
source files. This will happen gradually over time.
Breaking Changes
- The
position
argument ingithub.PullRequest.create_review_comment(position=…)
has been renamed toline
.
This breaks user code that callscreate_review_comment
with keyword argumentposition
. Call withline=…
instead.
Calling this method with positional arguments is not breaking. - The
jwt_expiry
,jwt_issued_at
andjwt_algorithm
arguments ingithub.GithubIntegration()
have changed their position.
User code callinggithub.GithubIntegration(…)
with these arguments as positional arguments breaks.
Please use keyword arguments:github.GithubIntegration(…, jwt_expiry=…, jwt_issued_at=…, jwt_algorithm=…)
. - The
since
argument ingithub.PullRequest.get_review_comments(…)
has changed position.User code calling
github.PullRequest.get_review_comments(…)with this argument as positional argument breaks. Please use keyword argument:
github.PullRequest.get_review_comments(since=…)`.
Deprecations
- The use of
github.Github(login_or_token=…)
is deprecated, usegithub.Github(auth=github.Auth.Login(…))
orgithub.Github(auth=github.Auth.Token(…))
instead. - The use of
github.Github(password=…)
is deprecated, usegithub.Github(auth=github.Auth.Login(…))
instead. - The use of
github.Github(jwt=…)
is deprecated, usegithub.Github(auth=github.AppAuth(…))
orgithub.Github(auth=github.AppAuthToken(…))
instead. - The use of
github.Github(app_auth=…)
is deprecated, usegithub.Github(auth=github.Auth.AppInstallationAuth(…))
instead. - The use of
github.GithubIntegration(integration_id=…, private_key=…, jwt_expiry=…, jwt_issued_at=…, jwt_algorithm=…)
is deprecated, usegithub.GithubIntegration(auth=github.Auth.AppAuth(…))
instead. - The use of
github.GithubIntegration.create_jwt
is deprecated, usegithub.Github(auth=github.Auth.AppAuth)
,github.Auth.AppAuth.token
orgithub.Auth.AppAuth.create_jwt(expiration)
instead. - The use of
AppAuthentication
is deprecated, usegithub.Auth.AppInstallationAuth
instead. - The use of
github.Github.get_app()
without providing argumentslug
is deprecated, usegithub.GithubIntegration(auth=github.Auth.AppAuth(…)).get_app()
.
Bug Fixes
- Test and fix UTC issue with AppInstallationAuth (#2561) (ff3b80f)
- Make Requester.__createException robust against missing message and body (#2159) (7be3f76)
- Fix auth issues with
Installation.get_repos
(#2547) (6407512) - Fix broken urls in docstrings (#2393) (f82ad61)
- Raise error on unsupported redirects, log supported redirects (#2524) (17cd0b7)
- Fix GithubIntegration that uses expiring jwt (#2460) (5011548)
- Add expiration argument back to GithubIntegration.create_jwt (#2439) (822fc05)
- Add crypto extras to pyjwt, which pulls in cryptogaphy package (#2443) (554b2b2)
- Remove RLock from Requester (#2446) (45f3d72)
- Move CI to Python 3.11 release and 3.12 dev (#2434) (e414c32)
- Pass Requester base URL to integration (#2420) (bdceae2)
Improvements
- Add Webhook Deliveries (#2508) (517ad33)
- Add support for workflow jobs and steps (#1951) (804c310)
- Add support for get_app() with App authentication (#2549) (6d4b6d1)
- Allow multiline comments in PullRequest (#2540) (6a21761)
- Implement
AppUserAuth
for Github App user tokens (#2546) (f291a36) - Add support for environments (#2223) (0384e2f)
- Add support for new RepositoryAdvisories API 🎉 (#2483) (daf62bd)
- Make
MainClass.get_app
return completedGithubApp
when slug is given (#2543) (84912a6) - Add authentication classes, move auth logic there (#2528) (fc2d0e1)
- Add sort order and direction for getting comments (#2544) (a8e7c42)
- Add
name
filter toRepository.get_artifacts()
(#2459) (9f52e94) - Add
name
,display_title
andpath
attributes toWorkflowRun
(#2397) (1081638) - Add new
create_fork
arguments (#2493) (b94a83c) - add
ref
to Deployment (#2489) (e8075c4) - Add query
check_suite_id
integer toWorkflow.get_runs
(#2466) (a485451) - Add
generate_release_notes
parameter tocreate_git_release
andcreate_git_tag_and_release
(#2417) (49b3ae1) - Add example for Pull Request comments to documentation (#2390) (c2f12bd)
- Add allow_auto_merge support to Repository (#2477) (8c4b946)
- Add
artifact_id
argument toRepository.get_artifact()
(#2458) (4fa0a5f) - Add missing attributes to Branch (#2512) (e296dbd)
- Add allow_update_branch option to Organization (#2465) (bab4180)
- Add support for Issue.state_reason #2370 (#2392) (5aa544a)
- Add parameters to Repository.get_workflow_runs (#2408) (4198dbf)
Maintenance
- Add type stub for MainClass.get_project_column (#2502) (d514222)
- Sync GithubIntegration init arguments with github.Github (#2556) (ea45237)
- Update MAINTAINERS (#2545) (f4e9dcb)
- Link to stable docs, update introduction in package used by pypi, move auth arg front (#2557) (006766f)
- Merge PaginatedList.pyi back to source (#2555) (cb50dec)
- Merge GithubObject.pyi/Requester.pyi stubs back to source (#2463) (b6258f4)
- [CI] Moving linting into separate workflow (#2522) (52fc107)
- Merging 1.58.x patch release notes into master (#2525) (217d424)
- Merge AppAuthentication.pyi to source (#2519) (8e8cfb3)
- Merge GithubException.pyi stubs back to source (#2464) (03a2f69)
- Add missing fields from
GithubCredentials.py
to CONTRIBUTING.md (#2482) (297317b) - Update docstring and typing for allow_forking and allow_update_branch (Repository) (#2529) (600217f)
- Bump actions/checkout from 2 to 3.1.0 (#2327) (300c501)
- RTD: install current project (def5223)
- Add current dir sys.path as well (9c96faa)
- Use use_scm_version to get current version from git tag (#2429) (3ea91a3)