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.
* Drop Travis CI
* Update DEPLOY.md about new workflow of uploading new version to PyPI
* Upload coverage data to Codecov
Co-Authored-By: Steve Kowalik <steven@wedontsleep.org>
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.
To integrate better with the GitHub workflow, add a workflow for
checking pushes and PRs. This doesn't remove the Travis configuration,
which is still required for releases.
Co-Authored-By: Christian Clauss <cclauss@me.com>
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
The testStatistics testcase takes over ten seconds to run on my laptop,
and it does an awful lot of work. Split up the disparate parts into
seperate testcases.
* Use pytest to parametrize tests
Use built-in pytest test case parametrization support over external
'parameterize' package. The latter is not well maintained, and has
known Python 3.8 failures unsolved since November 2019.
Since pytest fixtures are incompatible with unittest-style tests,
rewrite the relevant test case to use pytest-style asserts. This also
makes the resulting code simpler, as we no longer have to pass TestCase
to the helper classes.
* Refactor input cleaning in ReplayingConnection.__readNextRequest()
* 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