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.
Authenticating via client_id and client_secret is dangerous, since they
appended to the query string, and can be easily seen from the URL.
client_id/client_secret have been deprecated since May 2020, and ignored
by GitHub since late 2020, so it's high time they were removed.
Since the headers that led to an exception are also useful, firstly pass
them into the constructor, and then export them in a property. Test one
specific use case to make sure of coverage.
Fixes#1814
When a previous commit added support for creating secrets on repository
objects, support was not added to also remove them. Since the GitHub API
does support that, add a method to do so.
* Manually fixing paths for codecov.io to cover all project files
* Update codecov.yml
Fixes#1812
Co-authored-by: Steve Kowalik <steven@wedontsleep.org>
With GitHub moving away from allowing authentication to the API using an
username and password, update our documentation to remove it and rely on
tokens. Perhaps we should link to how to create an API token, but that
can be addressed later.
Fixes#1851
requests has a default connections pool of 10. Creating multiple threads
will consume from that same pool, since the underlying implementation of
the requests pool is a singletown.
Let's make the pool_size configurable, so clients can set the proper
number for their use case when running multiple threads.
Signed-off-by: Amador Pahim <apahim@redhat.com>