Commit Graph
1785 Commits
Author SHA1 Message Date
Steve Kowalik b30c09aaa4 Create a tox docs environment (#1426)
To make it easier to build documentation locally, add a new tox
environment that installs our requirements and runs Sphinx.
2020-03-08 16:36:52 +11:00
Steve Kowalik 3d93ee1ce5 Add Deployments API (#1424)
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
2020-03-08 16:27:59 +11:00
Jody McIntyre 425280cee7 Add support for editing project cards (#1418)
* Add edit() to ProjectCard

* Add unit tests of ProjectCard.edit
2020-03-08 14:24:35 +11:00
Wan Liuyang 96494965ee Merge pull request #1422 from ahhda/draft_pull_request
Add support for draft pull request
2020-03-07 14:27:25 +08:00
Anuj Bansal bd0211eb73 Add draft flag parameter, update tests 2020-03-07 11:42:41 +05:30
Steve Kowalik c822dd1ce0 Switch to using pytest (#1423)
Due to the recent deprecation of setup.py test, we should move with the
times, and switch to a non-deprecated test runner.

Add configuration for pytest, and switch tox to using it. Remove
AllTests, since it is no longer required to locate test classes, and
rewrite tests/__main__.py as a pytest conftest plugin.

Also drop the test function from manage.sh, tox does a much better job.
2020-03-07 12:43:49 +11:00
Steve Kowalik f2939eb731 Fix GitMembership with a hammer (#1420)
While investigating pytest, I discovered this test class was not
imported in AllTests, so it never ran, and worse, it would always fail
because it would get a NamedUser, and not an AuthenticatedUser. Add it
in it, and hit it with a hammer until it passes.
2020-03-06 22:54:42 +11:00
Steve Kowalik 1c82573d6f Add support to reply to a Pull request comment (#1374)
* Add create_review_comment_reply to PullRequest

* Add unit tests

* Add docs for comment_id param for create_review_comment_reply

* Update tests

* Fix pep8 styling issue

* Fix styling
2020-03-06 11:13:12 +11:00
Steve Kowalik 806130e93d PullRequest.update_branch(): allow expected_head_sha to be empty (#1412)
* PullRequest.update_branch(): allow expected_head_sha to be empty

* PullRequest.testUpdateBranch(): test also with empty expected_head_sha

* Updated replay data for PullRequest.testUpdateBranch

* tox formatted changes
2020-03-06 11:00:40 +11:00
Steve Kowalik aeb27b788c Implement ProjectCard.delete() (#1417)
To work towards implementing more of the API surrounding Project Cards,
add a delete method. With thanks to Christopher Mitchell, Ph.D.

Fixes #1409
2020-03-05 15:35:04 +11:00
Wan Liuyang d6f2795342 Create FUNDING.yml 2020-02-28 08:20:51 +08:00
Steve Kowalik 2991e9f178 Unpin coverage to 5.0.3 only (#1397)
To not force distributions to patch our requirements, loosen the
coverage test dependency.
2020-02-14 14:32:23 +11:00
Wan Liuyang 08b1c474b3 Add pre-commit plugin for black/isort/flake8 (#1398)
* Add pre-commit plugin for black/isort/flake8

* Update .pre-commit-config.yaml

* Add a few more useful hooks
2020-02-13 18:49:35 +08:00
Wan Liuyang 125536fe69 Add tox (#1388)
* Add tox.ini

* Fix typo

* Update .gitignore

* Move flake8 to tox

* Add py35

* Add Coverage

* Add Coverage

* Add Coverage

* Add Coverage

* Add black

* Add black

* Add black

* Skip black for py35

* Add isort

* Update contributing docs

* Remove empty line
2020-02-13 17:54:02 +08:00
Isac Souza 0396a4931a Open file in text mode in scripts/add_attribute.py (#1396) 2020-02-13 12:59:28 +11:00
Steve Kowalik dd31a70659 Silence most ResourceWarnings (#1393)
A few test classes were failing to call tearDown() of the superclass,
which meant the file descriptors of their replydata files were leaking.
Make sure to call it, and switch every other callsite of superclasses by
name to using argument-less super().

Revert an AllTests change that snuck in during release.
2020-02-12 15:05:32 +11:00
Wan Liuyang f8bf46f82b black 2020-02-12 02:01:58 +08:00
Steve Kowalik d6dee0164a Assert more attributes in Membership (#1391)
To increase code coverage, assert more attributes in Membership.
2020-02-11 16:33:04 +11:00
Steve Kowalik 6e3ceb193b Assert on changed Repository attributes (#1390)
To increase code coverage, assert on more attributes of Repository
during the testEditWithAllArguments testcase.
2020-02-11 14:53:15 +11:00
Steve KowalikandJonathan Leitschuh 0829af815f Add reset to the repr for Rate (#1389)
Add the reset attribute to the repr for Rate, and add a test for good
measure.

Co-Authored-By: Jonathan Leitschuh <jonathan.leitschuh@gmail.com>
2020-02-11 14:17:52 +11:00
Steve Kowalik e5ce4912f5 Publish version 1.46 2020-02-11 12:33:45 +11:00
Glenn McDonald 9564cd4de7 Add repo edit support for delete_branch_on_merge (#1381)
* Add repo edit support for delete_branch_on_merge

* Assert delete_branch_on_merge
2020-02-11 12:24:33 +11:00
Steve Kowalik 784deb5f68 Run black over the entire tree (#1386)
It's been a while since black was run over the entire tree, and since CI
still doesn't check it, we can get behind.
2020-02-11 10:37:25 +11:00
Wan Liuyang e76cc11271 Remove Travisbuddy 2020-02-11 00:31:39 +08:00
Tim Gates ad040bafaf Fix mistake in Repository.create_fork() (#1383)
I modified #1306 to use the NotSet parameter after
it was pointed out this was more appropriate however
I did not also update the conditional.
2020-02-09 20:38:50 +11:00
Steve Kowalik 882fe0871a Correct two attributes in Invitation (#1382)
Proving once again that untested code is broken code, correctly set two
attributes during initialization of Invitation. Increase coverage by
checking every attribute.
2020-02-09 17:45:51 +11:00
Huw Jones 4ae1a1e523 Search repo issues by string label (#1379)
* Allow use of strings for labels in Repository.get_issues

* Fix unittests

* Update docstring

* Removed brackets from "list of..."
2020-02-09 16:41:33 +11:00
Steve Kowalik 2af3e60d1b Fix two deprecation warnings (#1371)
Sort out two deprecation warnings to help silence the test suite.
2020-01-25 16:35:01 +11:00
Steve Kowalik ead565adf8 Correct Repository.create_git_tag_and_release() (#1362)
Repository.create_git_tag_and_release() is a convience function that
creates a git tag and then a release. It was not passing the SHA1 of the
commit to the release function, resulting in incorrect releases.

Fixes #1336
2020-01-25 16:34:48 +11:00
Steve Kowalik da747b5bd0 Unpin sphinx requirement (#1370)
Now that we support Python 3, we can stop pinning sphinx to the last
version with Python 2 support.
2020-01-23 12:26:33 +11:00
Steve Kowalik 37122cf2bb Switch to no argument super() (#1361)
Now that Python 2 support is gone, we can switch to no argument super()
rather than calling our superclass by name.
2020-01-21 21:15:22 +11:00
Geoff Low 06a300aee0 exposed seats and filled_seats for Github Organization Plan (#1360)
Expose two new attributes for Organization Plans
2020-01-21 10:27:19 +11:00
Steve Kowalik 0e09983dca Repository.create_project() body is optional (#1359)
The POST parameters passed to the create_project API call did not
consider the body optional, and always included it. Fix up a formatting
error in the docstring for good measure.

Fixes #1357
2020-01-19 14:31:58 +10:00
Steve Kowalik b11add4193 Implement move action for ProjectCard (#1356)
ProjectCard's have the ability to be moved between columns, implement
the GitHub API to do so.

Fixes #1312
2020-01-19 14:30:19 +10:00
Steve Kowalik dd80a6c091 Tidy up ProjectCard.get_content() (#1355)
ProjectCard.get_content() did not document its one argument or assert
its type. Do so, as well as generally tidy up the calls.
2020-01-17 13:44:18 +10:00
Gilad Shefer eacabb2fb9 Added nested teams and parent (#1348)
* Added nested teams and parent

- Added github.Team.Team.get_teams() to get nested teams.
- Added github.Team.Team.parent which points to the parent team.

Fixes #1337
2020-01-12 10:17:54 +10:00
Steve Kowalik 16e5f9891f Correct parameter for Label.edit (#1350)
The existing code for Label.edit was passing 'name' as a parameter to
the PATCH call, but GitHub expects 'new_name', correct it.
2020-01-12 10:16:39 +10:00
Steve Kowalik fc7109eab7 Correct reqirements.txt path in RTD config 2020-01-11 10:40:33 +10:00
Steve Kowalik 437487853f Add configuration for Read the Docs (#1347)
Read the Docs defaults to using Python 2 to build the documentation, so
add a configuration file so we use a supported (upstream and by us)
version.

Fixes #1341
2020-01-11 10:35:54 +10:00
Nabil BENDAFI d5ad09ae35 doc: example of Pull Request creation (#1344)
Add an example of creating a pull request
2020-01-11 10:16:45 +10:00
Steve Kowalik fc4eff3185 Fix all but one sphinx warnings (#1346)
To hopefully correct our doc build, tidy up some of the warnings that
sphinx complains about. The one remaining one is legitimate.
2020-01-11 10:15:34 +10:00
Steve Kowalik b7894ea00c Drop Python 2 support (#1329)
With the Python 2 deadline gone, it's time to move with the times and
switch to Python 3 only.
2020-01-06 18:01:38 +11:00
sharkykh 4561930b82 Fix PyPI wheel deployment (#1330)
`distributions` should be under `deploy`, not `deploy.on`
https://docs.travis-ci.com/user/deployment/pypi/#uploading-different-distributions
2019-12-29 18:04:31 +11:00
Steve Kowalik 7134752c36 Publish version 1.45 2019-12-29 14:48:30 +11:00
Steve Kowalik d938f80be0 Run black and isort to prepare for release (#1328)
Run black and isort over github/*py and tests/*py to prepare for a new
release.
2019-12-29 11:53:00 +11:00
Steve Kowalik 60464f6554 Allow sha=None for InputGitTreeElement (#1327)
InputGitTreeElement is used to build tree objects for
Repository.create_git_tree(). However, the GitHub API allows passing
sha=null to delete a file, which we don't allow. Extend the checking in
InputGitTreeElement to also allow None, and add a test for good measure.

Fixes #1318
2019-12-29 10:50:23 +11:00
Nick Campbell 732fd26abd Support github timeline events. (#1302)
Adds support for retrieval of Github timeline events.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
2019-12-29 10:50:05 +11:00
Steve Kowalik 88e30057a7 Remove API preview parameter (#1325)
The API preview flag for both MainClass and Requester was the last
hard-coded custom header, and it seems to not be relevant since
mid-2015. Remove it, if any users are using it, they shouldn't be. Its
code path was also entirely untested.
2019-12-29 10:49:45 +11:00
Bharat Raghunathan e1537f79bc Update link to GitHub Enterprise in README (#1324) 2019-12-27 12:08:57 +11:00
Steve Kowalik 8189a53885 Cleanup travis config (#1322)
Xenial has been the default distribution since May, 2019, so tidy up the
test matrix to no longer specify it. Furthermore, due to not quoting the
distributions in the deploy config, we did not ship wheels on pypi.

Fixes #1321
2019-12-21 20:57:34 +11:00