Commit Graph
270 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 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
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
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
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
Wan Liuyang ca6fbc4552 Add download_url to ContentFile, closes #575 2018-04-06 18:30:43 +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
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
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
sfdye 365a0a24d3 Apply fix_headers script to update copyright info 2018-03-17 20:06:16 +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
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
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
Michael Behrisch e671fdd035 Fix date format for milestone creation (#593) 2018-02-06 14:21:51 -08:00
R1kk3r cbfe8d0f62 Remove the default "null" input send during GET request (#691)
* Remove the default "null" input send during GET request

* Remove the 'null' value from all tests
2018-01-31 16:16:11 -08:00
edquist 2f9b1e018a make created_at/published_at attrs available for Release objects (#689) 2018-01-26 11:59:30 -08:00
Andrew Smith 45d18436fd Add method to get latest release of a repository (#609) 2018-01-16 13:57:24 -08:00
Iraquitan Cordeiro Filho 6cfe46b712 Add permissions field to NamedUser (#676) 2018-01-16 13:52:52 -08:00
Simon 6bc804dc15 ♻️ Fix all pep8 coding conventions 2018-01-16 13:41:02 -08:00
Hugo 6735be4933 Drop support for EOL Python 2.5-2.6 and 3.2-3.3 (#674) 2017-12-20 22:52:00 -08:00
Nicolas Agustín Torres ba50af53a0 Add Reactions feature (#671)
* List reactions of issue

* Create issue reaction

* List reactions of an issue comment

* Create a reaction on an issue comment

* List reactions of a commit comment

*  Create a reaction on a commit comment

* List reactions of a pull request review comment

* Create a reaction on a pull request review comment

* Delete reaction

* Renames IssueReaction to Reaction

* Fixes docstring in Reaction class

* Removes issue_url on Reaction class

* Fixes string concatenation that does not work on python 2.6
2017-12-14 19:23:33 -08:00
Wan Liuyang 6169d8eaa2 Add ping_url and ping to Hook (#669) 2017-12-10 14:57:28 -08:00
Wan Liuyang e5bfdbeb06 Add unit test for tree attribute of GitCommit (#668) 2017-12-10 14:46:57 -08:00
Jimmy Zelinskie dbc6f5abf0 Add read_only attribute to Deploy Keys (#570) 2017-12-07 20:11:10 -08:00
Balázs Rostás 5c41120a8a Added missing parameters for repo creation (#623)
* Added missing parameters to organisation repo creation

* team_id should already be an id not a team object

* Name arguments in the test

* Fixed assertion check

* Added missing parameters to user repo creation

* Fixed comments
2017-11-27 14:25:00 -08:00
Chris McBride 52449649a4 Add ability to access github Release Asset API. (#525)
* Add ability to access github Release Asset API.
See: https://developer.github.com/v3/repos/releases
2017-11-27 10:01:03 -06:00
Mike Miller ebe7277a7f Add 'submitted at' to PullRequestReview (#565)
This field is not currently listed in the Github documentation at
https://developer.github.com/v3/pulls/reviews/, but it's been included
since Github 2.9

(It even exists in the test data returned for the original
PullRequestReview PR)
2017-11-23 03:49:41 -08:00