Commit Graph
1681 Commits
Author SHA1 Message Date
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
Steve Kowalik f1ae7200ba Update Repository.update_file() docstring (#1186)
The docstring for Repository.update_file() insisted that content be
base64 encoded, which is not quite correct, update it.

Closes #1069
2019-08-05 09:14:06 +10:00
Steve Kowalik 6e79d2704b Correct return type of MainClass.get_organizations (#1179)
The doc string and the code disagreed about the return type of
MainClass.get_organizations(), correct the code, which was incorrect.

Fixes #1177
2019-07-23 22:38:36 +10:00
Jaskaran Singh 9b1c1e0904 Add cryptography to test-requirements.txt (#1165) 2019-07-20 23:59:52 +08:00
Wan Liuyang 1ced054592 Publish version 1.43.8 2019-07-20 23:56:37 +08:00
Kevin Rickard 8b6b4505b6 Fix bug in recursive repository contents example (#1166)
The previous code would prematurely exit when the intermediate contents list holds one thing, and that one thing has not been processed / expanded yet. Now the exit condition is when the contents list is empty, and there is nothing left to be processed.
2019-07-12 16:30:15 +10:00
ebrown a0731685f5 Add two factor attributes on organizations (#1132)
* Add 2fa attribute on organizations

* Fix property name and test value
2019-07-03 14:51:28 +08:00
Steve Kowalik 57af1e0526 Add Repository methods for pending invitations (#1159)
Make a start on implementing more of the invitations API, by adding
methods to Repository to list and remove pending invitations.

Closes #1120
2019-07-03 14:48:30 +08:00
Steve Kowalik 26c595d9b6 Silence most flake8 warnings (#1162)
Continue my crusade to running flake8 against new contributions by
cleaning up whitespace (and wierdly, the entire indentation of
Migration) to silence most flake8 warnings. AllTests is the remaining
outlier, and requires some thought on how to approach.
2019-07-03 10:35:17 +08: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
Steve Kowalik 828b53b756 Silence more flake8 errors (#1160)
Make more whitespace changes to silence flake8 errors under the github
directory only.
2019-07-02 17:55:04 +08:00
Steve Kowalik b8dad9817e Clean up a lot of pyflakes warnings (#1153)
Clean up unused imports or unused variables to mostly silence pyflakes.
We aren't quite yet in a place where we can run it via Travis, but baby
steps.
2019-07-02 18:06:09 +10:00
Steve Kowalik 0f2beaca83 Add invitee and inviter to Invitation (#1156)
Invitations contain information about the user they are for, and
which user invited them, so export that too.

During invesigating attmepting to test the new attributes of Invitation,
it was discovered that there are no code paths to fetch them, so add
AuthenticatedUser.get_invitations(). The test added can do double duty.
2019-07-02 10:59:04 +08:00
Shibasis PatelandWan Liuyang edab176b5d Adding support for pending team invitations (#993)
* fixes issue#823

* Update GithubObject.py

* Added tests for Pending team invitations(Issue#823)


Co-authored-by: Wan Liuyang <tsfdye@gmail.com>
2019-06-28 11:35:58 +08:00
Moritz Schubotz fd090eccbb Update Repository.rst (#1118)
the example confused me until I found https://github.com/PyGithub/PyGithub/issues/545
2019-06-27 22:36:40 +10:00
Steve Kowalik befce37e20 Do not import directly into Retry tests (#1155)
The Retry test class was importing Repository directly, which had the
side effect of masking the tests.Repository import in AllTests with
github.Repository. Switch to importing github only, which is safe. As a
drive-by, switch to using self.assertRaises for one of the tests.
2019-06-27 20:39:08 +10:00
Steve Kowalik 8d2a6b534d Allow name to be specified for upload_asset (#1151)
GitRelease.upload_asset() calculates the name based on the filename, and
doesn't allow it to be overridden. Add a new name argument that is used
if it is set. Drive by changing the default of the content_type argument
to NotSet.

Closes #1095
2019-06-24 15:14:23 +08:00
Pascal Bach 03939fe55c Fix assertion in add_to_members (#1146)
The role parameter is set to NotSet by default
but the assertion only allowed str and unicode.
So it would always fail. Add NotSet to the assertion
to allow calling the function without a role.

Signed-off-by: Pascal Bach <pascal.bach@nextrem.ch>
2019-06-21 10:01:15 +08:00
chillipeper 6cd0d644cf Add support for custom base_url in GithubIntegration class (#1093)
* Add support for custom base_url in GithubIntegration

* Fix non default argument issue
2019-06-20 16:08:04 +08:00
Tomas Tomecek 18187045a4 GithubIntegration: enable getting installation (#1135)
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
2019-06-20 16:05:53 +08:00
Geoffroy Jabouley ef6f009dc3 Add sorting capability to Organization.get_repos() (#1139) 2019-06-20 15:51:55 +08:00
Steve Kowalik 4349bca136 Add new Organization.get_team_by_slug method (#1144)
Add a new API call to Organization that allows fetching teams by
slug.

Closes #1116
2019-06-20 15:40:20 +08:00
Brian Choy 4a37860bc4 Add description field when creating a new team (#1125) 2019-05-23 08:07:53 +08:00
Steve Kowalik 102c820806 Handle a path of / in Repository.get_contents() (#1070)
The path requested in Repository.get_contents() is appended to the URL,
so the root path should be requested with the empty string. If path is
'/', set it to the empty string. Copy the replay data from the original
test, since it is identical.

Drive-by renaming the test to include the missing 's'.

Closes #1059
2019-05-22 15:10:27 +08:00
Wan Liuyang 3d43e9c0e6 update doc, fix #1123 2019-05-21 10:02:14 +08:00
Wan Liuyang 01737a13f8 Merge get_file_contents with get_contents 2019-05-07 10:47:22 +08:00
Filipe LaínsandWan Liuyang ec7bbcf586 issue: add lock/unlock (#1107)
* issue: add lock/unlock

* tests: add test for issue lock/unlock

* tests: add lock/unlock sample data

* Fix tests, add locked and active_lock_reason


Co-authored-by: Wan Liuyang <tsfdye@gmail.com>
2019-05-06 09:38:05 +08:00
Caleb Sweeney 54065792b8 fixes #1106 for GitHub Enterprise API (#1110) 2019-05-03 09:24:59 +08:00
Wan Liuyang f716df86bb Publish version 1.43.7 2019-04-16 11:49:45 +08:00
TechnicalPirate 78d283b9b5 Updated setup.py to exclude tests (#1031)
# Problem #
The `.whl` available on PyPi for this repository contains its entire `tests` submodule. 

The total size of the `pygithub` module is less than `1mb` without tests and `>23mb` with. 

Previous discussions on this topic indicated the removal of tests would be accepted if someone created a pull request to do so: https://github.com/PyGithub/PyGithub/issues/672 

This is that pull request! 😄

# Solution/Implementation # 

- Moved "tests" to root of the repository ( outside the package ) 
    - Added `tests.` module path to the imports in `AllTests.py`
- Updated `setup.py`
    - Removed `package_data` from product
    - Removed "tests" from packages definition
    - Repointed `test_suite` to new location
- Updated `travis.yml`
    - Added conditional ( if not `py2.7` ) conversion of code to `py3`

_... apologies for all the failed build spam below - new to working with Travis CI / had some gotcha moments!_
2019-04-16 11:45:02 +08:00
Wan Liuyang 4c0b54c0c6 Add code coverage (#1090)
* Add codecov to travis

* Add badge
2019-04-15 10:44:06 +08:00
Jake Wilkins 818bd78fe9 Use non-deprecated path for creating GitHub App access tokens (#1086)
/installations/<installation_id>/access_tokens was deprecated as of
https://developer.github.com/changes/2018-08-16-renaming-and-deprecation-of-github-app-installation-access-token-route/
2019-04-10 10:11:06 +08:00
Wan Liuyang fcc2670873 Publish version 1.43.6 2019-04-05 14:32:18 +08:00
Alex 293846bee3 Add url parameter to include anonymous contributors in get_contributors() (#1075)
Add the anon parameter missing from get_contributors() so anonymous contributors can be included in results as specified in the [Github REST API Reference](https://developer.github.com/v3/repos/#list-contributors).
2019-04-05 13:51:40 +08:00
Isac Souza 5ae7af55ea Adding communications Retry functionality into requests via urllib3 retry object. (#1002)
This is a continuation of the work started by @allevin on https://github.com/PyGithub/PyGithub/pull/860.

I have refactored the testing Framework to use the `httpretty` library in order to use the urllib3 retry feature and therefore be able to test it.

Please refer to https://github.com/PyGithub/PyGithub/pull/860 for additional context.

cc: @allevin @mfonville @jrouquie @sfdye

Closes #757 
Closes #860
2019-04-05 13:49:01 +08:00
Wan Liuyang 6efd631890 Remove status API, closes #1080 2019-04-04 13:54:09 +08:00
Jon Dufresne 74c3040ae4 Run pyupgrade across the project (#1067)
https://github.com/asottile/pyupgrade

- Use dict comprehension
- Use set literals
2019-03-29 15:43:37 +08:00
cclauss 6faa00ac9f Travis CI: Add Python 3.7 to the testing (#1028)
Also:
* Python 3.4 reaches its end of life in 44 days so let's remove it from the testing.  https://devguide.python.org/#branchstatus
* [Travis are now recommending removing the __sudo__ tag](https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration).
2019-03-29 15:41:57 +08:00
Hamel Husain 86a9d8e973 provide option to extend expiration of jwt token (#1068)
supply optional parameter for `create_jwt` method
2019-03-29 15:37:36 +08:00
Jamie van Brunschot 7ee6c41753 add since and before to get_notifications (#1074)
Needed this for getting notifications in a certain period and noticed that it wasn't implemented.
2019-03-29 15:22:57 +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 8ef71b1b37 Add new dismiss() method on PullRequestReview (#1053)
The GitHub v3 API has the ability to dismiss reviews, export it by way
of a new dismiss() method on PullRequestReview.

Closes #1050
2019-02-28 10:11:30 +08:00
秋葉 6a89eb645d resolves #1023 (#1042)
resolves #1023
2019-02-14 10:50:11 +08:00
Dirk Avery 8c1a13e294 Update link/description of project (#1043) 2019-02-13 09:34:30 +08:00
Raihaan 480f91cf1d Fix Organization.add_to_members() role passing (#1039)
* Fix role passing

* Fix typo

* Fix another typo

* Move parameter to JSON payload

* Move parameter to JSON payload

* Add content type

* Add content type

* Double Quotes

* Double quotes
2019-02-12 14:39:44 +08:00
Vincent d6ba5d7235 fixed: comment of ProjectColumn.create_card (#1041) 2019-02-12 14:37:01 +08:00
Wan Liuyang f0e0762a0d Publish version 1.43.5 2019-01-29 17:34:47 +08:00
秋葉 ff789dcc81 fix request got an unexpected keyword argument body (#1012)
Resolves #1010
2019-01-18 15:37:08 +08:00
Benoit Latinier 5f5c276465 add: create project column card route (#1003)
Add the missing route to create cards for projects columns
Test written and passing locally.
2019-01-18 11:51:04 +08:00
Surya Teja 10bacb486a user.node_id missing (#1001)
'node_id' attribute was missing. Hence added the attribute using add_attribute script in AuthorizedUser  and NamedUser classes. 
This fixes issue #999 .
2019-01-10 20:49:52 +08:00