Commit Graph
79 Commits
Author SHA1 Message Date
Anuj Bansal bf62f75224 Add create_project support, add tests (#1429)
Add AuthenicatedUser.create_project()
2020-03-10 12:34:57 +11:00
Glenn McDonald 9564cd4de7 Add repo edit support for delete_branch_on_merge (#1381)
* Add repo edit support for delete_branch_on_merge

* Assert delete_branch_on_merge
2020-02-11 12:24:33 +11: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
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
Adam Baratz a076508370 Stop ignoring unused imports and remove them (#1250)
* Stop ignoring unused imports and remove them

* Stop ignoring * imports
2019-10-19 16:43:14 +11:00
Pavan Kunisetty e50420f771 Implemented user organization membership. Added test case. (#1237)
1. Added AuthenticatedUser:get_organization_membership
2. Added NamedUser:get_organization_membership
3. Added related tests as GitMembership and related replay data
2019-10-03 22:33:06 +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
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
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
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
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
Shubham Singh b4d895eddd Adding migration api wrapper (#899)
Closes #818
2018-12-21 12:01:01 +08:00
Alice GIRARD 0a10d7cdf0 Mark notification as read (#932)
Wraps the parts of the notification API that allows the user to mark notifications as read.
New methods are : 
 
- Notification.mark_as_read : marks a single notification thread as read
- Repository.mark_notifications_as_read : marks all the notifications for a given repository as read
- AuthenticatedUser.mark_notifications_as_read : marks all the notifications as read

Aims to fix : https://github.com/PyGithub/PyGithub/issues/571 and simply uses the APIs described on this page : https://developer.github.com/enterprise/11.10.340/v3/activity/notifications/

A weird thing I noticed doing this is that Repository.notifications_url doesn't seem to be usable directly. I used Repository.url + "/notifications" instead.
2018-10-19 07:24:45 +08:00
Riccardo Pittau c411196f24 get repos missing params for authenticated users (#915)
first commit to fix issue #435
2018-10-04 15:55:11 +08:00
Bruce Richardson e18b107883 Gists with since (#914)
The Github gists api has a since parameter for the various gist searches.  This adds that parameter to Github.get_gists(), NamedUser.get_gists() and Authenticator.get_gists().  Tests and replay data added/updated as needed.

I added a Time module in the tests directory, containing just a UTCtzinfo class, which I felt I needed for one of the tests (and would probably be useful in other since/until tests).  Might not be the best name for the module but it seemed the least invasive thing to do.
2018-10-03 11:51:59 +08:00
Wan Liuyang ae5cdb285e Refactor common header constants and custom media type 2018-08-21 15:01:23 +08:00
Steve Kowalik ebcd3a52e3 Remove custom swamp-thing-preview header (#873)
The Repository Invitation API graduated on July 17, 2017, so the custom
Accept header is no longer required.
2018-08-21 13:49:04 +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
Wan Liuyang a32a17bf81 Fix broken Github reference link in class docstrings 2018-03-13 15:07:07 +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
Simon 6bc804dc15 ♻️ Fix all pep8 coding conventions 2018-01-16 13:41:02 -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
Jannis Gebauer 4c64b28920 added repository collaborator invitation 2017-07-10 13:14:09 +02: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
E. Dunham ba66862179 Document how one gets an AuthenticatedUser object 2016-07-05 14:23:58 -07:00
Vincent Jacques b402e5ddd5 Merge commit 'pull/275/head' 2014-09-28 13:45:52 -07:00
Tomas Radej cff1a422c2 Capitalization of the 2FA OTP request header 2014-09-24 11:49:55 +02: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 580528876a Acknowledge some lack of test coverage 2014-05-04 12:18:00 -07:00
Cameron White 36352598ae Added onetime_password to create_authorization
github.AuthenticatedUser.create_authorization has been modified to
support two-factor authentication. When two-factor authentication
is enabled create_authorization will throw an TwoFactorException.
The onetime password can be then be passed to create_authorization
on a subsequent call.
2013-12-19 04:05:26 -08:00
poulp de8932976f Add /user/teams (GET) 2013-12-07 22:00:09 +01: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
Vincent Jacques 64cf539c83 #193: Add a param to Requester.requestXxx for request headers 2013-08-23 11:31:01 +02:00
Vincent Jacques 5c475c7683 First review of #192 (pep8, headers... nothing important)
./manage.sh check
./manage.sh fix_headers
2013-08-22 10:12:38 +02:00
AKFish 912bec79d2 Update copyright information 2013-08-21 17:45:01 +08:00
AKFish c4e8972be1 Update UserKey.py 2013-08-21 17:19:11 +08:00
AKFish 3c1d17cd64 Update Repository.py 2013-08-21 17:13:03 +08:00
AKFish 6cb6e8d232 Update Notification.py 2013-08-21 16:58:25 +08:00
AKFish dc8173a532 Update Gist*.py 2013-08-21 15:39:34 +08:00
AKFish 0e19d8e04e Update Authorization.py 2013-08-21 15:09:34 +08:00
AKFish 28a49b94d8 Update AuthenticatedUser.py 2013-08-21 15:06:21 +08:00
AKFish ca6189c3c9 Change CompletableGithubObject.__init__ without breaking build. 2013-08-21 14:49:20 +08:00