The GitHub API exposes an endpoint to rename a branch, so we should
support calling it. Sadly, there is not enough information to add
that method to the Branch class, so expose it in the Repository object.
Fixes#1901
When calculating totalCount for a PaginatedList, if a Link header is not
in the returned data, we use len() to calculate the number of items.
PullRequest.get_review_requests() actually returns a dictionary, which
neatly defeats this naive method. Peer inside the dictionary in this
case, and add a test case.
Fixes#2053
One piece of missing functionality is the ability to delete Workflow
Runs, which the GitHub API supports. Add a delete() method to
WorkflowRun.
Fixes#2019
A recently merged change modified AuthenticatedUser.get_notifications()
in how it passes boolean parameters, but did not modify the replay data.
Do so now.
The parameters 'all' and 'participating' for AuthenticatedUser.get_notifications() should
be lower case strings, not textual forms of a boolean.
Fixes: #1671
When black was added, we did not want to run it under Python 3.5, since
upstream did not support it. We no longer support Python 3.5 ourselves,
so we no longer need to restrict the version black uses.
It appears recently that typing information for jwt and requests has
been split out into seperate projects on pypi, namely types-jwt and
types-requests. Since we utilise calling functions in their namespace,
we need to install them otherwise mypy will fail.
Requester.__log() sanitizes the headers of the request so that
authentication details are not logged, but this has the side effect of
meaning that future requests that use the same Requester object will
fail. Usually, this is perfectly fine, since almost every method will
only make one request -- where this falls down is when we make another
after a redirect. Make a copy of the requestHeaders, and sanitize those.
Fixes#1959
OrderedDict needs to be typed just like Dict needs to be typed. The
OrderedDict "input" variable key and value are used to append to a
string without any processing, so it seems unlikely that something other
than a string would be valid.
Since exporting headers in GithubException might require passing them in
a constructor for client code, shift it as a breaking change so users
watch out for it.
It appears we run codespell over all documentation, so common typos are
picked up by CI. In other news, I must remember to run lint before
creating a release.
The tests path is not part of the shipped project, thus this type cannot
be checked by users of this project.
The correct type in place of the type imported from tests appears to be
Optional[
Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]
]
As a property these functions are expected to be accessed without the
private __get_ and __set_ functions, however while the functions are
typed, the property is not, and mypy shows an attribute error.
As this codebase no-longer requires support for python versions without
support for @property.setter(2.6?) this updates the functions to use
decorators and updates the type files to reflect the attribute
existence.
Now that GitHub have moved their documentation from
developer.github.com, we should update our links. I have also tried to
update the call strings to their new format, but since it was done via
regex, some of them may not match exactly.
* Adding attributes "maintain" and "triage" to class "github.Permissions.Permissions"
* Fix for failed test due to extended attribute list
* Adding new simplistic test case for class Permissions
Fixes#1809
Since GitHub has the bad manners to return bare strings for some API
endpoints, one sharp edge has been that JSON decoding errors were masked
since we wrap the string in a dictionary. However, this makes it
difficult to debug malformed JSON in replay data, so re-raise the
exception if the first character is a { or [ (IE, it's an object or
list.)
Both CheckSuite and Commit have a get_check_runs() method that allows
filtering by a string -- the original code did not check for it, and
never added it to the query string since it checked the wrong variable.
Check the right variable and re-record the replay data.
Fixes#1843
The assertions in github.Project.edit looked like the result of a bad
copy-paste operation: they were all making assertions about the `name`
parameter. This commit fixes them so they are checking different parameters.