Commit Graph
1762 Commits
Author SHA1 Message Date
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
Tim Gates baddb7193f Add support for update branch (#1317)
* Add Support for PullRequest update-branch

* Add test case

* Fix test case

* Add test data record

* Update PullRequest.py

* Update PullRequest.py

* Support py2.7

* Assert response status is 202

* black + isort
2019-12-12 20:50:25 +08:00
Steve Kowalik b0ef1909f9 Refactor Logging tests (#1315)
To stop skipping logging tests on Python 3, refactor them to mock out
the logger and check arguments directly, rather than naively comparing
strings. Allow a logger to be injected into Requester for this.
2019-12-11 16:02:14 +11:00
Wan Liuyang c44df80d9a Ignore some isort change 2019-12-11 00:58:13 +08:00
Wan Liuyang 540a085001 Fix isort - add known first and third party 2019-12-11 00:54:59 +08:00
Wan Liuyang b797cac021 Fix rtd build 2019-12-10 23:19:55 +08:00
Wan Liuyang 88549a56df black 2019-12-10 23:13:34 +08:00
Wan Liuyang 573c674b80 Add .git-blame-ignore-revs 2019-12-10 17:30:24 +08:00
Wan Liuyang 6ceb9e9a15 Apply black to whole codebase (#1303) 2019-12-10 17:14:33 +08:00
Kevin LaFlamme f8e33620f4 Fix class used returning pull request comments (#1307)
Repository.get_pull_request_comments() was returning the wrong type.
2019-11-30 12:14:50 +11:00
Tim Gates 2ad51f352e Support for create_fork (#1306)
* Support for create_fork

http://developer.github.com/v3/repos/forks

* Add test case for create_fork

* Add param doc and fix extra line

* Specify the organization to increase line coverage

* Update test data

* Add type assert for organization param
2019-11-28 21:44:00 +11:00
Steve Kowalik e40768e03b Use Repository.get_contents() in tests (#1301)
Two tests were calling Repository.get_dir_contents() which is
deprecated. To stop the warnings, change the call sites.
2019-11-26 14:30:06 +11:00
Steve Kowalik 989b635e33 Allow GithubObject.update() to be passed headers (#1300)
SourceImport.update() is really GithubObject.update(), which just calls
GET on the object's URL. Refetching a source import requires an
additional header, so change GithubObject.update() to pass any it is
given, and add a test for SourceImport.update()

Fixes #1297
2019-11-26 14:29:24 +11:00
Steve Kowalik 3170cafce5 Correct URL for assignees on PRs (#1296)
The URL that was used for POST/DELETE when adding and removing
assignees was the PR itself, when it should be the issue_url.

Fixes #1294
2019-11-25 20:44:13 +11:00
Jiri Popelka fb19d2f271 Use inclusive ordered comparison for 'parameterized' requirement (#1281) 2019-11-25 20:38:07 +11:00
Steve KowalikandJonas Maurus 3e3d8c54ab Fix Branch's push restriction API (#1290)
The current API for changing user and teams push restrictions is
brittle, and flat out incorrect when it comes to adding members. Break
the API, but replace it with one that is correct.

Co-Authored-By: Jonas Maurus <jonas-github@maurus.net>
2019-11-22 20:49:58 +11:00
Steve Kowalik 21e89ff1f8 Deprecate Repository.get_dir_contents() (#1285)
Repository.get_contents() and Repository.get_dir_contents() call the
same endpoint, with slightly different error handling, and with the
difference that get_dir_contents() throws an odd exception if you call
it with a file. get_contents() already even handles being called for a
directory anyway, so deprecate get_dir_contents(), and refactor the code
so the tests pass.

Fixes #1283
2019-11-14 22:17:34 +11:00
Steve Kowalik 3a7232522b Apply some polish to manage.sh (#1284)
Use set -e in manage.sh for some safety, and allow the remote to be
overridden for those of us who have different setups, and switch to
using flake8 for checks like travis does.
2019-11-11 18:36:24 +11:00
Steve Kowalik 05b9ecb471 Publish version 1.44.1 2019-11-07 12:44:10 +11:00
Steve Kowalik fec6034a07 Add Python 3.8 to classifiers list (#1280)
Add 3.8 to the classifiers list, drop the use of 2to3, and run tests
against 3.8.
2019-11-06 22:11:09 +11:00
Adam Baratz ac68274200 Expand Topic class and add test coverage (#1252)
* Expand Topic class and add test coverage

* Add test coverage for Topic properties

* Fix misspelling in comment
2019-11-04 15:06:52 +11:00
Adam Baratz ec3c8d7b3b Add support for team discussions (#1246) (#1249)
* Add support for team discussions (#1246)

* Make a TeamDiscussion completeable
2019-10-31 21:19:10 +11:00
Steve Kowalik 077c80ba2d Correct API for NamedUser.get_organization_membership (#1277)
NamedUser.get_organization_membership() was calling the API method for
fetching the currently authenticated user only, which is incorrect. The
method was not tested directly, so add tests.  Furthermore, Membership
had some errors which had slipped through review, so correct them.

Sadly, this is an API break, since passing the organization as an int
made no sense in this case.

Fixes #1276
2019-10-31 20:56:46 +11:00
Steve Kowalik 6ad592b1b6 Correct header check for 2FA required (#1274)
Currently, we were checking for an uppercase header if GitHub was
refusing our authentication because we didn't provide a token. Requests
returns headers with all lowercase. Fix the const, and add a test for
good measure.

Fixes #1273
2019-10-25 21:01:58 +11:00