The typing information for the update_file() method's content parameter
states it will only accept str, whereas it will accept both str and
bytes.
Fixes#1542
When Workflow support was added, the method calls were not added to
the typing file for Repository, and somehow the class name for the
Workflow typing file was incorrect.
While chasing coverage failures, I discovered PullRequestReview's do not
send back a URL at all, which means firstly, the url property is not
required because it will always be None, and secondly, the object can
never be completed. I'm not certain why this change broke the test, but
it looked brittle, refactor it to be clearer.
To increase coverage, sprinkle in some asserts for attributes that were
not checked -- this uncovered a bug in Issue that two attributes were
not properly initialized to NotSet.
This is the only class that includes property setters for two of the
attributes, which are untested, and even if they were used, would have
no impact since there is no method to submit the changes back to GitHub.
Drop them.
There were multiple calls checking if an element of a list was a string
or a string -- I suspect this pre-dates use of six in the code base, but
let's clean it up.
A lot of our missing coverage is caused by not checking repr(), which is
trivial enough to test against -- do so, and also clean up existing repr
tests to look the same by calling repr(). Where it was trivial, add a
few assertions about missing attributes.
The API endpoint Repository.get_workflows() calls returns data in a list
item, not directly, leading to some head scratching when calling it
against GitHub. Re-record the replay data.
client_id and client_secret are sent to GitHub encoded on the query
string, which GitHub has firmly deprecated, so much so as to email
people who are doing so. To discourage its use, raise a FutureWarning if
they are specified.
Fixes#1500
Previously you could call it only on Repository or NamedUser. Now you can call it with any GithubObject subclass -- and the type is carried through to the return value.
To start supporting GitHub Actions, add the first part of that,
Workflow, which encapsulates a workflow over the API, along with
two methods on Repository to query them.
When IncompletableObject was added, it was only added to
GithubException, and not imported directly into the github namespace
like other exceptions. Correct that, and clean up the resultant now
unrequired import.
Deployment, TimelineEvent{,Source} were missing mypy stubs, since they
were added after the mypy branch was started. Add them, and clean up two
spurious __future__ imports that are no longer required. Add mypy's
cache directory to .gitignore
* Add "get_repo_permission" to Team class
* second attempt:
- accept repo name or repo object
- return github.Permissions.Permissions object
- try and following CONTRIBUTING.md better
* add missing import to tests
patch replay data with permission data
* assert a specific permission rather than just the type
Fixes#1415
The two methods PullRequest.add_to_assignees() and
PullRequest.remove_from_assignees() are special, in that they call
POST/DELETE on the issue_url of the pull request, and then transform all
their attributes based on what was returned. This has a number of
effects, none of them any good for calling new methods on the same pull
request object. Instead, only pull out the changed attribute and use
that. Also change the returned URL for the POST call in the replay data
to match what GitHub returns.
Fixes#1406
The function create_git_tag_and_release had no docstring, so it didn't
appear anywhere in our docs. Add a short one linking to the two methods
it calls.
Fixes#1402
Add a new class, Deployment to describe a deployment performed utilising
GitHub. Add three methods onto Repository to list them and create them.
Fixes#1117