Skip to content

Commit 14ae2ca

Browse files
authored
Release 1.59.0 (#2563)
1 parent ff3b80f commit 14ae2ca

File tree

5 files changed

+108
-11
lines changed

5 files changed

+108
-11
lines changed

doc/changes.rst

Lines changed: 101 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,107 @@ Change log
44
Stable versions
55
~~~~~~~~~~~~~~~
66

7+
Version 1.59.0 (June 22, 2023)
8+
-----------------------------------
9+
10+
**Important**
11+
12+
This release introduces new way of authentication. All authentication-related arguments ``github.Github(login_or_token=…, password=…, jwt=…, app_auth=…)``
13+
and ``github.GithubIntegration(integration_id=…, private_key=…, jwt_expiry=…, jwt_issued_at=…, jwt_algorithm=…)`` are replaced by a single ``auth=…`` argument.
14+
Module ``github.Auth`` provides classes for all supported ways of authentication: ``Login``, ``Token``, ``AppAuth``, ``AppAuthToken``, ``AppInstallationAuth``, ``AppUserAuth``.
15+
Old arguments are deprecated but continue to work. They are scheduled for removal for version 2.0 release.
16+
17+
This project has decided to move all typing information from ``.pyi`` files into the respective ``.py`` source files.
18+
This will happen gradually over time.
19+
20+
**Breaking Changes**
21+
22+
* The ``position`` argument in ``github.PullRequest.create_review_comment(position=…)`` has been renamed to ``line``.
23+
This breaks user code that calls ``create_review_comment`` with keyword argument ``position``. Call with ``line=…`` instead.
24+
Calling this method with positional arguments is not breaking.
25+
* The ``jwt_expiry``, ``jwt_issued_at`` and ``jwt_algorithm`` arguments in ``github.GithubIntegration()`` have changed their position.
26+
User code calling ``github.GithubIntegration(…)`` with these arguments as positional arguments breaks.
27+
Please use keyword arguments: ``github.GithubIntegration(…, jwt_expiry=…, jwt_issued_at=…, jwt_algorithm=…)``.
28+
* The ``since`` argument in ``github.PullRequest.get_review_comments(…)`` has changed position.``
29+
User code calling ``github.PullRequest.get_review_comments(…)`` with this argument as positional argument breaks.
30+
Please use keyword argument: ``github.PullRequest.get_review_comments(since=…)``.
31+
32+
**Deprecations**
33+
34+
* The use of ``github.Github(login_or_token=…)`` is deprecated, use ``github.Github(auth=github.Auth.Login(…))`` or ``github.Github(auth=github.Auth.Token(…))`` instead.
35+
* The use of ``github.Github(password=…)`` is deprecated, use ``github.Github(auth=github.Auth.Login(…))`` instead.
36+
* The use of ``github.Github(jwt=…)`` is deprecated, use ``github.Github(auth=github.AppAuth(…))`` or ``github.Github(auth=github.AppAuthToken(…))`` instead.
37+
* The use of ``github.Github(app_auth=…)`` is deprecated, use ``github.Github(auth=github.Auth.AppInstallationAuth(…))`` instead.
38+
* The use of ``github.GithubIntegration(integration_id=…, private_key=…, jwt_expiry=…, jwt_issued_at=…, jwt_algorithm=…)`` is deprecated, use ``github.GithubIntegration(auth=github.Auth.AppAuth(…))`` instead.
39+
* The use of ``github.GithubIntegration.create_jwt`` is deprecated, use ``github.Github(auth=github.Auth.AppAuth)``, ``github.Auth.AppAuth.token`` or ``github.Auth.AppAuth.create_jwt(expiration)`` instead.
40+
* The use of ``AppAuthentication`` is deprecated, use ``github.Auth.AppInstallationAuth`` instead.
41+
* The use of ``github.Github.get_app()`` without providing argument ``slug`` is deprecated, use ``github.GithubIntegration(auth=github.Auth.AppAuth(…)).get_app()``.
42+
43+
**Bug Fixes**
44+
45+
* Test and fix UTC issue with AppInstallationAuth (#2561) (ff3b80f8)
46+
* Make Requester.__createException robust against missing message and body (#2159) (7be3f763)
47+
* Fix auth issues with `Installation.get_repos` (#2547) (64075120)
48+
* Fix broken urls in docstrings (#2393) (f82ad61c)
49+
* Raise error on unsupported redirects, log supported redirects (#2524) (17cd0b79)
50+
* Fix GithubIntegration that uses expiring jwt (#2460) (5011548c)
51+
* Add expiration argument back to GithubIntegration.create_jwt (#2439) (822fc05c)
52+
* Add crypto extras to pyjwt, which pulls in cryptogaphy package (#2443) (554b2b28)
53+
* Remove RLock from Requester (#2446) (45f3d723)
54+
* Move CI to Python 3.11 release and 3.12 dev (#2434) (e414c322)
55+
* Pass Requester base URL to integration (#2420) (bdceae2f)
56+
57+
**Improvements**
58+
59+
* Add Webhook Deliveries (#2508) (517ad336)
60+
* Add support for workflow jobs and steps (#1951) (804c3107)
61+
* Add support for get_app() with App authentication (#2549) (6d4b6d14)
62+
* Allow multiline comments in PullRequest (#2540) (6a21761e)
63+
* Implement `AppUserAuth` for Github App user tokens (#2546) (f291a368)
64+
* Add support for environments (#2223) (0384e2fd)
65+
* Add support for new RepositoryAdvisories API :tada: (#2483) (daf62bd4)
66+
* Make `MainClass.get_app` return completed `GithubApp` when slug is given (#2543) (84912a67)
67+
* Add authentication classes, move auth logic there (#2528) (fc2d0e15)
68+
* Add sort order and direction for getting comments (#2544) (a8e7c423)
69+
* Add `name` filter to `Repository.get_artifacts()` (#2459) (9f52e948)
70+
* Add `name`, `display_title` and `path` attributes to `WorkflowRun` (#2397) (10816389)
71+
* Add new `create_fork` arguments (#2493) (b94a83cb)
72+
* add `ref` to Deployment (#2489) (e8075c41)
73+
* Add query `check_suite_id` integer to `Workflow.get_runs` (#2466) (a4854519)
74+
* Add `generate_release_notes` parameter to `create_git_release` and `create_git_tag_and_release` (#2417) (49b3ae16)
75+
* Add example for Pull Request comments to documentation (#2390) (c2f12bdc)
76+
* Add allow_auto_merge support to Repository (#2477) (8c4b9465)
77+
* Add `artifact_id` argument to `Repository.get_artifact()` (#2458) (4fa0a5f3)
78+
* Add missing attributes to Branch (#2512) (e296dbdb)
79+
* Add allow_update_branch option to Organization (#2465) (bab4180f)
80+
* Add support for Issue.state_reason #2370 (#2392) (5aa544a1)
81+
* Add parameters to Repository.get_workflow_runs (#2408) (4198dbfb)
82+
83+
**Maintenance**
84+
85+
* Add type stub for MainClass.get_project_column (#2502) (d514222c)
86+
* Sync GithubIntegration __init__ arguments with github.Github (#2556) (ea45237d)
87+
* Update MAINTAINERS (#2545) (f4e9dcb3)
88+
* Link to stable docs, update introduction in package used by pypi, move auth arg front (#2557) (006766f9)
89+
* Merge PaginatedList.pyi back to source (#2555) (cb50dec5)
90+
* Merge GithubObject.pyi/Requester.pyi stubs back to source (#2463) (b6258f4b)
91+
* [CI] Moving linting into separate workflow (#2522) (52fc1077)
92+
* Merging 1.58.x patch release notes into master (#2525) (217d4241)
93+
* Merge AppAuthentication.pyi to source (#2519) (8e8cfb30)
94+
* Merge GithubException.pyi stubs back to source (#2464) (03a2f696)
95+
* Add missing fields from `GithubCredentials.py` to CONTRIBUTING.md (#2482) (297317ba)
96+
* Update docstring and typing for allow_forking and allow_update_branch (Repository) (#2529) (600217f0)
97+
* Bump actions/checkout from 2 to 3.1.0 (#2327) (300c5015)
98+
* RTD: install current project (def5223c)
99+
* Add current dir sys.path as well (9c96faa7)
100+
* Use use_scm_version to get current version from git tag (#2429) (3ea91a3a)
101+
7102
Version 1.58.2 (May 09, 2023)
8103
-----------------------------------
9104

10105
**Bug Fixes**
11106

12-
- Fix GithubIntegration that uses expiring jwt (#2460) (5011548c)
107+
* Fix GithubIntegration that uses expiring jwt (#2460) (5011548c)
13108

14109
Version 1.58.1 (March 18, 2023)
15110
-----------------------------------
@@ -30,11 +125,11 @@ Version 1.58.0 (February 19, 2023)
30125

31126
**Bug Fixes & Improvements**
32127

33-
- Add unarchiving support @Tsuesun (#2391)
34-
- Support full GitHub app authentication @dblanchette (#1986)
35-
- Continue the PR #1899 @Felixoid (#2386)
36-
- feat: add allow\_forking to Repository @IbrahimAH (#2380)
37-
- Add code scanning alerts @eric-nieuwland (#2227)
128+
* Add unarchiving support @Tsuesun (#2391)
129+
* Support full GitHub app authentication @dblanchette (#1986)
130+
* Continue the PR #1899 @Felixoid (#2386)
131+
* feat: add allow\_forking to Repository @IbrahimAH (#2380)
132+
* Add code scanning alerts @eric-nieuwland (#2227)
38133

39134
Version 1.57 (November 05, 2022)
40135
-----------------------------------

github/AppAuthentication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from github.Auth import AppAuth, AppInstallationAuth
2929

3030

31-
@deprecated.deprecated("Use app.Auth.AppInstallationAuth instead")
31+
@deprecated.deprecated("Use github.Auth.AppInstallationAuth instead")
3232
class AppAuthentication(AppInstallationAuth):
3333
def __init__(
3434
self,

github/GithubIntegration.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ class GithubIntegration:
2222
# keep non-deprecated arguments in-sync with Requester
2323
# v2: remove integration_id, private_key, jwt_expiry, jwt_issued_at and jwt_algorithm
2424
# v2: move auth to the front of arguments
25-
# v2: add * before first argument so all arguments must be named,
25+
# v2: move * before first argument so all arguments must be named,
2626
# allows to reorder / add new arguments / remove deprecated arguments without breaking user code
27+
# added here to force named parameters because new parameters have been added
2728
def __init__(
2829
self,
2930
integration_id=None,
3031
private_key=None,
3132
base_url=Consts.DEFAULT_BASE_URL,
33+
*,
3234
timeout=Consts.DEFAULT_TIMEOUT,
3335
user_agent=Consts.DEFAULT_USER_AGENT,
3436
per_page=Consts.DEFAULT_PER_PAGE,
@@ -151,7 +153,7 @@ def _get_installed_app(self, url):
151153
)
152154

153155
@deprecated.deprecated(
154-
"Use github.Auth.AppAuth.token or github.Auth.AppAuth.create_jwt(expiration) instead"
156+
"Use github.Github(auth=github.Auth.AppAuth), github.Auth.AppAuth.token or github.Auth.AppAuth.create_jwt(expiration) instead"
155157
)
156158
def create_jwt(self, expiration=None):
157159
"""

github/MainClass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def __init__(
106106
"""
107107
:param login_or_token: string deprecated, use auth=github.Auth.Login(...) or auth=github.Auth.Token(...) instead
108108
:param password: string deprecated, use auth=github.Auth.Login(...) instead
109-
:param jwt: string deprecated, use auth=github.Auth.AppAuthToken(...) instead
109+
:param jwt: string deprecated, use auth=github.Auth.AppAuth(...) or auth=github.Auth.AppAuthToken(...) instead
110110
:param app_auth: github.AppAuthentication deprecated, use auth=github.Auth.AppInstallationAuth(...) instead
111111
:param base_url: string
112112
:param timeout: integer

tests/Authentication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def testAppAuthentication(self):
8080
self.assertEqual(g.get_user("ammarmallik").name, "Ammar Akbar")
8181
self.assertWarnings(
8282
warning,
83-
"Call to deprecated class AppAuthentication. (Use app.Auth.AppInstallationAuth instead)",
83+
"Call to deprecated class AppAuthentication. (Use github.Auth.AppInstallationAuth instead)",
8484
"Argument app_auth is deprecated, please use auth=github.Auth.AppInstallationAuth(...) instead",
8585
)
8686

0 commit comments

Comments
 (0)