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
- Add parent_team_id, maintainers and notification_setting for creating and updating teams. by @Cheshirez in #2863
- Add support for issue reactions summary by @smuzaffar in #2866
- Support for DependabotAlert APIs by @coopernetes in #2879
- Derive GraphQL URL from base_url by @EnricoMi in #2880
- Make
Repository.compare().commits
return paginated list by @EnricoMi in #2882 - Add missing branch protection fields by @treee111 in #2873
- Add
include_all_branches
tocreate_repo_from_template
ofAuthenticatedUser
andOrganization
by @janssonoskar in #2871 - Add and update organisation dependabot secrets by @mohy01 in #2316
- Add missing params to
Organization.create_repo
by @tekumara in #2700 - Update allowed values for
Repository
collaborator permissions by @flying-sheep in #1996 - Support editing PullRequestReview by @ColasGael in #2851
- Update attributes after calling
PullRequestReview.dismiss
by @ColasGael in #2854 - Add
request_cve
onRepositoryAdvisories
by @JLLeitschuh in #2855 - Filter collaborators of a repository by permissions by @notmicaelfilipe in #2792
- Set pull request to auto merge via GraphQL API by @heitorpolidoro in #2816
- Support Environment Variables and Secrets by @AndrewJDawes in #2848
- Update workflow.get_runs & pullrequest.add_to_assignees function signature by @sd-kialo in #2799
- Add
GithubObject.last_modified_datetime
to havelast_modified
as adatetime
by @chouetz in #2772 - Add support for global advisories and unify some shared logic with repository advisories by @crimsonknave in #2702
- Add
internal
as valid Repository visibility value by @AndrewJDawes in #2806 - Add support for issue comments reactions summary by @smuzaffar in #2813
Bug Fixes
- Add a bunch of missing urllib.parse.quote calls by @ExplodingCabbage in #1976
- Fix Variable and Secret url bugs by @AndrewJDawes in #2835
Maintenance
- Update the class name for NetrcAuth in the examples by @vinnybod in #2860
- Move build to PEP517 by @trim21 in #2800
- Use new type assert functions in
Repository
by @trim21 in #2798 - PyTest: Move config to pyproject.toml by @Borda in #2859
- codespell: ignore-words-list by @Borda in #2858
- Improve fix-headers.py script by @EnricoMi in #2728
- Remove dependency on python-dateutil by @lazka in #2804
- CI: update precommit & apply by @Borda in #2600
- Docs: Fix parameter order according to Version 2.1.0 by @nad182 in #2786
- Add missing GitHub classes to docs by @EnricoMi in #2783
- CI: Fix mypy error by ignoring override by @EnricoMi in #2779
Full Changelog: v2.1.1...v2.2.0