Commit Graph
83 Commits
Author SHA1 Message Date
Florent Clarret e0997b438e Add and handle the maintainer_can_modify attribute in PullRequest (#1465) 2020-04-26 10:04:12 +08:00
Alice GIRARDandLiuyang Wan 91433fe925 Type stubs for mypy (#1231)
* First attempt at stubs

* fix AuthenticatedUser.piy

* fix PullRequest.piy

* fix Authorization.piy

* fix Branch.piy

* fix Clones.piy

* fix Commit.piy

* fix CommitCombinedStatus.piy

* fix CommitComment.piy

* fix CommitStatus.piy

* fix ContentFile.piy

* fix Download.piy

* fix Event.piy

* fix File.piy

* fix Gist.piy

* fix GistComment.piy

* fix GistFile.piy

* fix GitAuthor.piy

* fix GitBlob.piy

* fix GitCommit.piy

* fix GitRef.piy

* fix GitRelease.piy

* renamed stubs into pyi files

* fix Notification

* fix Repository

* fix GitReleaseAsset

* fix GitTag

* fix GitTree

* fix GitTreeElement

* fix GithubException

* fix GithubObject

* fix GitignoreTemplate

* fix HookDescription

* fix HookResponse

* fix InputGitAuthor

* fix Installation

* fix InstallationAuthorization

* fix Invitation

* fix Issue

* fix IssueComment

* Fix random issues found while testing

* fix IssuePullRequest

* fix Label

* fix License

* fix Migration

* fix Milestone

* fix NamedUser

* fix NotificationSubject

* fix Organization

* fix PaginatedList

* fix Path

* fix Permissions

* fix Plan

* fix Project

* fix ProjectCard

* fix ProjectColumn

* fix PullRequestComment

* fix PullRequestMergeStatus

* fix PullRequestPart

* fix PullRequestReview

* fix Rate

* fix RateLimit

* fix Reaction

* fix Referrer

* fix RepositoryKey

* fix RequiredPullRequestReviews

* fix RequiredStatusChecks

* fix SourceImport

* fix Stargazer

* fix StatsCodeFrequency

* fix StatsCommitActivity

* fix StatsContributor

* fix Tag

* fix Team

* fix Topic

* fix UserKey

* fix MainClass

* fix Requester

* added stubs for View

* added stubs for Membership

* various syntax errors

* silence mypy noise

* keeping track of recent changes

* black + isort

Co-authored-by: Liuyang Wan <lwan@zendesk.com>
2020-03-22 19:33:23 +08:00
Steve Kowalik b1c35499f4 Don't transform completely in PullRequest.*assignees (#1428)
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
2020-03-10 12:39:23 +11:00
MarcoFalke bd28524853 Add draft attribute, update test 2020-03-09 12:20:12 +05:30
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 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
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
Wan Liuyang 540a085001 Fix isort - add known first and third party 2019-12-11 00:54:59 +08:00
Wan Liuyang 6ceb9e9a15 Apply black to whole codebase (#1303) 2019-12-10 17:14:33 +08: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
Pavan Kunisetty a163ba1562 Add assignee removal/addition support to PRs (#1241)
Add assignee removal/addition support to PRs
Fixes #1109

Add test for new PR assignee functionality

Add record file

Addressed comments on #1016
2019-10-22 21:34:55 +11:00
Olof-Joachim Frahm (欧雅福) b84d9b1928 Code review bodies are optional in some cases. (#1169)
* Code review bodies are optional in some cases.

* Add test for approving PRs without body set.
2019-09-20 11:00:07 +10:00
Olof-Joachim Frahm (欧雅福) e90cdab06d Fix PR review creation. (#1184)
Do not modify the attributes of a PR when creating a review.
2019-08-09 19:12:55 +10:00
Steve Kowalik f93207b4ca Run flake8 in Travis (#1163)
Clean up a few errors I missed, ignore another, and configure flake8 using
a config file to ignore certain errors. The next step would be to remove
the F* ignores.
2019-08-05 15:03:10 +10:00
Steve Kowalik dc2f2ad8cb Switch to using six (#1189)
With the Python 2.7 deadline fast approaching, modernize the codebase
making use of the modernize module to switch to using six, as well as
other upcoming features, such as absolute imports . Stop using 2to3
for Travis, yay!
2019-08-05 14:06:19 +10:00
Mark Browning acd515aaec Adds get_issue_events to PullRequest object (#1154)
* Adds `get_issue_events` to `PullRequest` object

* Add unit test for

* Fix PullRequest.get_issue_events unit test

Use actual event ids...

* Fix missing import on PullRequest.

I wish the unit tests would run in Python3...

* Add PulReqeust.testGetIssueEvents ReplayData

* Updating replay data to use developer's personal credentials.
2019-07-03 08:52:11 +08:00
MurphyZhao 118def30a3 [fix] the default vaule of 'PullRequest.create_review'`s commit param (#1058)
[fix] the default vaule of github.PullRequest.PullRequest.create_review`s input param commit.

In `POST /repos/:owner/:repo/pulls/:number/reviews`, 'commit_id' is not a necessary parameter.Reference [https://developer.github.com/v3/pulls/reviews/](https://developer.github.com/v3/pulls/reviews/)

Signed-off-by: MurphyZhao <d2014zjt@163.com>
2019-03-13 10:47:38 +08:00
Steve Kowalik b51227681d Add missing import to PullRequest (#1007)
PullRequest.get_review_comments() works with no arguments passed due to
if short circuiting, but as soon as you pass since, you get an exception
since datetime wasn't imported. Import it, and add a test case for good
measure.

Closes #1004
2019-01-04 22:28:54 +08:00
Brian J. Murrell a18eeb3a05 Line comments are not posted in create_review() (#909)
When create_review() is called with comments in the comments argument,
they are not actually posted in the API call.
2018-09-26 09:55:33 +08:00
Wan Liuyang 3f0caa4057 Sync copyright header 2018-08-19 10:47:41 +08:00
per1234 bed4009361 Fix incorrect formatting in docstrings (#816) 2018-06-11 22:24:27 +08:00
Steve Kowalik 85dcc44650 Correct docstring for set_labels (#766)
Both Issue and PullRequest have a set_labels method whose docstring did
not exactly describe the parameter, correct it.
2018-04-23 14:27:18 +08:00
Steve Kowalik e2e29918ea Re-work PullRequest reviewer request (#765)
Add create_review_request() and delete_review_request() methods to
PullRequest, as well as renaming get_reviewer_requests() to
get_review_requests() and cleaning up its return value to firstly respect
teams, and secondly to cut out the middleman of PullRequestReviewerRequests,
which has been removed.

Fixes #597
2018-04-23 14:22:51 +08:00
Steve Kowalik 6251212512 PullRequest review methods no longer need black cats (#760)
The preview period of the PullRequest review API ended May 9, 2017 so
remove the custom Accept headers for the relevant methods.
2018-04-19 16:07:52 +08:00
Steve Kowalik 00096c1059 Correct PullRequest.get_reviewer_requests() rtype (#761)
The return type of PullRequest.get_reviewer_requests() is a
PaginatedList containing PullRequestReviewerRequest.
2018-04-19 15:58:24 +08:00
Steve Kowalik 0dba048f5c Make use of issue_url in PullRequest (#755)
Clean up some of the issue methods in PullRequest to make use of the
issue_url property, rather than chopping pieces off the URL to replace
/pulls/ with /issues/.
2018-04-17 18:20:56 +08:00
Steve Kowalik 678b6b2006 PullRequest labels should use Issues URL (#754)
The Github API docs for PullRequests say to make use of the Issues API
to add, remove, set and query labels. This means that we need to make
use of the issue_url property for the PullRequest, not its own URL.
2018-04-17 10:21:26 +08:00
Steve Kowalik a308dc92df Support labels for PullRequests (#752)
PullRequests can also have labels attached to them, like Issues or
Milestones. Extend PullRequest to also export them if they are present,
as well as adding methods to add, remove and set labels.
2018-04-16 16:43:07 +08:00
Martin Monperrus fec3c94344 documentation: clarify semantics of get_comments (#743) 2018-04-07 23:41:38 +08:00
Shinichi TAMURA 6bf2acc74d Added Issue.as_pull_request() and PullReqest.as_issue() (#630) 2018-03-26 10:25:45 +08:00
Ben Yohay 612c35007e Add support for getting PR single review's comments. (#670) 2018-03-21 20:50:56 +08:00
Matt Babineau d85082858e adding since to PR review comments get (#577) 2018-03-21 14:44:10 +08:00
Gilad Shefer 162f0397bc Added option to create review for Pull request (#662)
* Added option to create review for Pull request

* Fix tests
2018-03-20 22:28:39 +08:00
sfdye 365a0a24d3 Apply fix_headers script to update copyright info 2018-03-17 20:06:16 +08:00
sfdye 58e1ef9ccb Fix copyright formatting 2018-03-13 22:30:47 +08:00
sfdye 020c136a40 Update doc link in copyright text 2018-03-13 22:07:38 +08:00
Gilad Shefer 5c9c2f7523 Updated PullRequest reviewer request according to API changes (#690)
https://developer.github.com/changes/2018-01-24-end-thor-preview/
2018-01-26 19:06:09 -08:00
Simon 6bc804dc15 ♻️ Fix all pep8 coding conventions 2018-01-16 13:41:02 -08:00
Thibault Jamet 3f77e53725 Add support for changing PR head commit (#632)
* Add support for changing PR head commit

Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>

* Add support for custom commit arguments

Add commit_title, merge_method and sha arguments to the pull request
merge method

Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
2018-01-16 13:26:38 -08:00
Aaron Levine b6b127d732 Updates to API and changes to resolve testing issues. 2017-03-24 14:45:04 -06:00
Aaron Levine 2f0e4e55fe Add Support for Pull Request Reviews feature 2017-03-20 14:44:26 -06:00
@tmshn c0de6be5ea Added "assignees" attribute to PullRequest object. 2016-11-22 20:03:30 +09:00
Jannis Gebauer 8571d87c77 adds a nicer __repr__ 2016-09-08 10:25:48 +02:00
Peter Buckley cb0cf0a680 update doc url everywhere (#420) 2016-07-12 16:38:02 -04:00
Vincent Jacques abca7a026e pep8
This is strange, maybe Cygwin's version is stricter.
No time to investigate.
2014-05-04 12:54:05 -07:00
Vincent Jacques 597e123029 Factorize the creation of attributes (preparation for #195) 2013-09-12 09:27:25 +02:00
Vincent Jacques 4a5009741a Use ValuedAttribute and NotSet.value (preparation for #195) 2013-09-12 00:40:27 +02:00
Vincent Jacques c0dae31a97 Add many missing attributes 2013-09-06 17:14:59 +02:00
Vincent Jacques f2feb81dae Add default parameters to greatly reduce code redoundancy 2013-09-06 11:01:32 +02:00