Commit Graph
864 Commits
Author SHA1 Message Date
Steve Kowalik bd0cf30970 Correct Repository.get_git_tree recursive use (#767)
The API docs for Repository.get_git_tree specify that the URL parameter
for fetching a tree recursively should be ?recursive=1, not a truthy
value. To not change the API we present, check if it is True before
setting it to 1. Change another callsite of Repository.get_git_tree to
specify recursive=False to make sure it doesn't appear in the query
string.

Fixes #560
2018-04-25 17:21:17 +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 1f23c06a4d Add support for team privacy (#763)
Teams contain support for privacy, by being either closed, or secret.
Export the string via a property, and allow editing it via the edit
method.
2018-04-20 15:17:58 +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
Jasper van Wanrooy c44469965e API outside collaborators (#533)
* API outside collaborators

* Include remaining to organization api calls.
2018-04-19 10:00:15 +08:00
Manu Hortet 980b67f930 Team description added to Team.py (#753)
* team description added to Team.py

* minor correction on initAttributes
2018-04-17 18:22:11 +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
Mike Miller 9aed19ddbe Use 'requests' instead of 'httplib' (#664)
* works (but tests fail)

* Refactor to use python requests rather than httplib

* add requests dependency in setup.py

* touch so travis-ci will run

* clean up some unused comments

* Handle HTTP vs HTTPS; handle custom base_url

* Use requests session

* Don't use a persistent session in tests (which don't use the real requests library)

* Use an older version of requests for python 3.2

Requests dropped support for Python 3.2 in the 2.10 series (though it
didn't detect this until 2.11).

PyGithub probably doesn't need to support Python 3.2 at all; it's quite
old, with negligably few users, but that should be addressed elsewhere.

* Revert "Use an older version of requests for python 3.2"

This reverts commit fb0367614f5413968eeab98f4094e710aa1bc2d1.

* Improve readability

* Update requirements.txt

* Disable custom proxy handling code (unneeded and broken); use requests'

* Remove comment and superflous code

* Fix iteritems() removal from Python3

* pin requests to 2.14.0 or greater in prep for no_proxy

* pin requests to 2.14.0 or greater in prep for no_proxy
2018-04-17 10:25:42 +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
Svend Sorensen 1e0150b527 Add get_organizations() (#748)
* Add get_organizations()

* Add unit tests for get_organizations
2018-04-12 08:50:42 +08:00
Nicholas Buse a769c2ffc1 Add documentation to github.Repository.Repository.create_git_release() (#747) 2018-04-10 10:16:22 +08:00
Tim Boring 4da483d1c0 Add add_to_members() and remove_from_membership() (#741)
* Add methods add_to_members(), has_in_pending_members(), and remove_from_membership() methods to Organization class.

* Add scrubbed replay files used for testing

* More massaging of test data

* Fix URL to remove organization membership

* Remove `has_in_pending_members()` method
2018-04-09 22:44:22 +08:00
Martin Monperrus fec3c94344 documentation: clarify semantics of get_comments (#743) 2018-04-07 23:41:38 +08:00
Wan Liuyang ca6fbc4552 Add download_url to ContentFile, closes #575 2018-04-06 18:30:43 +08:00
Jess Morgan eaa6a508f3 Add PullRequestComment.in_reply_to_id (#718)
Fix for issue #717
2018-04-06 18:17:20 +08:00
Raihaan 5cb5ab71b3 Add team privacy parameter to create team (#702)
* Add team privacy and add additional parameter to test. Still requires replaydata

* Reorder parameters to not break existing code

* Update tests for #702
2018-04-06 17:08:34 +08:00
Wan Liuyang b54ccc784e Implement License API (#734)
* Implement License API

* Update copyright
2018-04-06 09:17:19 +08:00
Wan Liuyang 911bf61522 Fix delete method for RepositoryKey 2018-04-05 10:25:04 +08:00
Wan Liuyang 722f253429 Remove edit for UserKey as it's immutable now 2018-04-05 10:23:01 +08:00
Mateusz Loskot 42e7593871 Labels API: support description (#738)
The description attribute handling requirement is
  a custom media type in the Accept header:
    application/vnd.github.symmetra-preview+json

Limitation: Repository.get_labels does not report description,
possibly something has changed in the preview API.
2018-03-29 18:16:20 +08:00
Shinichi TAMURA 6bf2acc74d Added Issue.as_pull_request() and PullReqest.as_issue() (#630) 2018-03-26 10:25:45 +08:00
Wan Liuyang ae261c821e Fix a bug for test recording when input is None 2018-03-22 16:38:19 +08:00
Ben Yohay 612c35007e Add support for getting PR single review's comments. (#670) 2018-03-21 20:50:56 +08:00
Laurent Raufaste 5e8c683261 Update the RepositoryKey class (#530)
# The problems I attempt to solve

- `RepositoryKey.created_at` is available on the Github API, but not in
PyGithub
- `RepositoryKey.edit()` is not supported anymore by the Github API,
see https://developer.github.com/v3/repos/keys/#edit-a-deploy-key

# How I went about solving the problem

I added myself a new deploy key to one of my repositories, and recorded
the existing tests using my account.
I could not keep the existing test data as the specified key does not
exist anymore, I added a comment for the next contributor to help him
figure out how to record new tests.
2018-03-21 15:09:31 +08:00
Matt Babineau d85082858e adding since to PR review comments get (#577) 2018-03-21 14:44:10 +08:00
Wan Liuyang 566b28d3fa Remove some duplicate attributes introduced in #522 2018-03-21 14:34:57 +08:00
Daniel Kesler c76e67b737 added tarball_url, zipball_url, prerelease and draft property (#522)
* added tarball_url, zipball_url, prerelease and draft property to GitRelease

* Add tests for new attributes
2018-03-21 14:23:56 +08:00
Hayden Fuss 864c663a16 Source Import API (#673)
* add import source

* add import header

* create/get source import for repo, SourceImport class

* Corrected use_lfs, not considered completed with creation

* vcs creds optional

* SourceImport test, removed unneeded attributes

* create/get source import tests for repo

* Encoding and copyright comment

* styling fixes

* Update SourceImport.py

* Update SourceImport.py

* Update SourceImport.py
2018-03-21 14:04:46 +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
Wan Liuyang 3cd176e3c3 Depreciate legacy search API 2018-03-20 20:27:27 +08:00
Michał Górny 10ee17a25c Filter team members by role (#491)
* Team: support filtering members by role

* Team: support adding membership with role
2018-03-17 22:05:13 +08:00
sfdye 365a0a24d3 Apply fix_headers script to update copyright info 2018-03-17 20:06:16 +08:00
Darragh Bailey 0fb176fd71 Add url attribute to PullRequestReview object (#731)
To compare PullRequestReview objects, they need to have the 'url'
attribute because the CompletableGithubObject expects to be able to
inspect a '_url' attribute on objects when testing for equality.
2018-03-16 22:49:01 +08:00
Shinichi TAMURA 0f0a7d4e68 Added target_commitish option to Repository.create_git_release() (#625)
* Added is_draft and is_prerelease property to GitRelease

* Added target_commitish option to Repository.create_git_release()

* Added test for Repository.create_git_release()

* Renamed attr of GitRelease: is_draft, is_prerelease -> draft, prerelease
2018-03-15 11:17:04 +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
Wan Liuyang a32a17bf81 Fix broken Github reference link in class docstrings 2018-03-13 15:07:07 +08:00
Anton Nguyen c7f6563c34 Add hook support for organizations (#729)
* Add hook support for organizations
Specifically, the create_hook, get_hook, and get_hooks calls

* Added support for the edit and delete hook functions
2018-03-12 23:02:52 +08:00
Isuru Fernando d9c5a07fcf Get organization from the team (#590)
* Get organization from the team

* Fix ReplayData for Team
2018-03-10 20:13:44 +08:00
Agor Maxime aa556f85a1 Finished search_commits PR (#727)
* Added support for newer commit search API endpoint

* Added tests for new commit search method on main Github class

* Fixed sort parameter of search_commits
2018-03-09 08:00:47 +08:00
Victor Granic f8b23505da Collaborator site admin (#719)
* Add admin_user property to NamedUser

* Fix type from string to bool for site_admin property

* Add a test for site_admin
2018-03-06 10:35:11 +08:00
bryanhuntesl 6109eb3c2b Fix add_to_watched for AuthenticatedUser (#716)
* 'watching' != 'staring' 

The functionality was completely broken - api endpoints were wrong/didn't work. Tested by logging in as an authenticated user - verified listing watches, add watch, and remove watch.

* fix unit tests
2018-03-03 12:02:41 +08:00
Wan Liuyang 8daae1375e Update doc link for PyPI 2018-03-02 11:37:27 +08:00
namc 8a13b27476 Add __eq__ and __hash__ to NamedUser (#706)
* Add __eq__ and __hash__ to NamedUser

* Remove extra outer brackets from __eq__ in NamedUser

* Add unit tests for __eq__ and __hash__

* Remove redundant brackets in __eq__ : NamedUser
2018-02-21 14:40:01 +08:00
Raihaan 0e5a1d1d53 Add maintainer can modify flag to create pull request (#703)
* Add flag for maintainer can modify when creating pull requests

* Change default to be None to let github decide the behaviour

* Update docstring

* Follow conventions from other functions
2018-02-15 10:07:26 +08:00
James D'Amato 01ab4cc6ae Add role parameter to Team.add_membership method (#638) 2018-02-07 01:25:24 -08:00
James D'Amato 5a1424bbc4 Add add_membership testcase (#637) 2018-02-07 01:17:30 -08:00