Commit Graph
166 Commits
Author SHA1 Message Date
Steve Kowalik 171cc567ae Update Branch Protection to current GitHub API
The Branch protection API has been radically changed by GitHub, add new
methods to Branch reflecting it. Branch protection methods are now
called on the Branch object itself, rather than awkwardly hanging off
the Repository object and requiring branch names to be passed in.

This adds an over-arching methods to get, edit and remove protection
entirely, as well as fine-grained methods for getting, setting and
dropping certain aspects of branch protection, as well as three new
objects to encompass querying those aspects.

This also destroys Repository.protect_branch(), the endpoint has been
removed. The old-style protection attributes on Branch have also been
removed to force users onto the new API, since they are still sent, but
no longer populated.

Fixes #586
2018-08-15 12:45:47 +10:00
Jacopo Notarstefano 29d231517d Add missing arguments to Repository.edit (#844)
As promised in https://github.com/PyGithub/PyGithub/pull/842, here's a PR to update the `edit` method so that it allows editing the newly added properties.
2018-07-15 10:32:53 +08:00
Jacopo Notarstefano 2b352fb397 Add missing properties to Repository (#842)
Closes #784
Closes #785

First commit fixes a small bug that I observed while trying to record some new test fixtures: the stringification of the headers is not correctly printed as a list of tuples, but as an `iteritems` object, so I forced the list evaluation.

Second commit adds the missing properties `allow_merge_commit`, `allow_rebase_merge`, `allow_squash_merge`, and `has_projects` to the `Repository` class.

Note however that I ran into some trouble while modifying the `edit` method of the `Repository` class to make use of the new properties, specifically while writing tests, so I will fix the `edit` method in a future PR.
2018-07-13 12:02:53 +08:00
sechastain 1a90f5db5d Adding archival support for Repository.edit (#843)
Fixes ##840 

Adding archival support to Repository.edit

No unit tests are included for this change because while you can archive a repository via the edit API, there is no way to un-archive a repository via the edit API.  (See: https://developer.github.com/v3/repos/#edit )
2018-07-12 11:17:51 +08:00
Will Yardley c6802b515f Add support for getting / replacing topics (#634) (#832)
* Add support for getting and replacing topics on a repository #634

* Add / fix tests, accept list vs dict for replace_topics (#634)
2018-07-06 11:09:10 +08:00
per1234 bed4009361 Fix incorrect formatting in docstrings (#816) 2018-06-11 22:24:27 +08:00
Steve Kowalik b1e9ae68a2 Branch protection methods no longer require loki (#775)
The Branch Protection API graduated September 1, 2017, so remove use of
the loki-preview+json header.
2018-04-30 10:10:32 +08:00
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
Nicholas Buse a769c2ffc1 Add documentation to github.Repository.Repository.create_git_release() (#747) 2018-04-10 10:16:22 +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
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
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
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
Wan Liuyang a32a17bf81 Fix broken Github reference link in class docstrings 2018-03-13 15:07:07 +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
John Hui 167f85efcd Add collaborator permission support (#699) 2018-02-07 00:27:11 -08:00
Brian Torres-Gil cef98416f4 Use datetime object in create_milestone (#698)
Method create_milestone now uses datetime object to fit better with v3 API using ISO8601.

Date object still allowed for backward compatibility.
2018-02-06 22:44:57 -08:00
Michael Behrisch e671fdd035 Fix date format for milestone creation (#593) 2018-02-06 14:21:51 -08:00
Ilya Konstantinov 3baa682cf8 Add committer/author to Repository.delete_file (#678) 2018-01-16 14:17:47 -08:00
Andrew Smith 45d18436fd Add method to get latest release of a repository (#609) 2018-01-16 13:57:24 -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
Andreas Lutro 35333e0390 Add Repository.archived property (#657) 2017-12-10 14:52:23 -08:00
Jimmy Zelinskie dbc6f5abf0 Add read_only attribute to Deploy Keys (#570) 2017-12-07 20:11:10 -08:00
Ben Firshman 317079efff Fix uploading binary files on Python 3 (#621)
There is a bit of logic for Python 2 that detects if you're
uploading string or bytes, but this is missing for Python 3.
2017-11-27 15:26:18 -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
Jason White 554c1ab124 Quote path for /contents API (#614)
This allows spaces and other special characters in the file path.

Fixes #613.
2017-11-22 12:57:31 -08:00
Jannis Gebauer 4c64b28920 added repository collaborator invitation 2017-07-10 13:14:09 +02:00
fukatani 01d4d5fc69 fix repository 2017-01-17 12:55:27 -06:00
Nhomar Hernández [Vauxoo] 9d14335657 Merge pull request #469 from tmshn/support-multiple-assignees
Support multiple assignees on Issue & PullRequest
2017-01-17 12:53:48 -06:00
Sylvus 4304ccddec Updated documentation 2016-11-27 15:02:16 +01:00
Sylvus a2da7f94c7 Added a subscribers count field 2016-11-27 15:00:19 +01:00
@tmshn ba007dc8a8 Added "assignees" argument in Repository.create_issue() 2016-10-10 11:08:52 +09:00
Jannis Gebauer 0799753530 adds support for content dirs 2016-09-15 14:22:22 +02:00
Jannis Gebauer 8571d87c77 adds a nicer __repr__ 2016-09-08 10:25:48 +02:00
fukatani 987bca00fa Fix small typo 2016-08-14 14:35:19 +09:00
ghfan 5404030119 change file content encoding to support unicode(like chinese), py2 2016-08-10 20:33:20 +08:00
Jannis Gebauer 0f29a53e17 fixed file API return values
The returned objects were not correctly populated, leaving us with
empty objects.

This is now fixed.
2016-07-29 09:54:31 +02:00
Jannis Gebauer 7390827c6c assert by str and unicode to make it more py3 friendly 2016-07-28 09:29:06 +02:00
Jannis Gebauer 446313ea81 Merge branch 'master' of https://github.com/enix223/PyGithub into enix223-master 2016-07-18 17:15:19 +02:00
Peter Buckley cb0cf0a680 update doc url everywhere (#420) 2016-07-12 16:38:02 -04:00
Per Øyvind Karlsen 8985368e29 fix wrong expectance on requestJsonAndCheck() returning {} if no data
When there's no data, requestJsonAndCheck(), or rather
__structuredFromJson() returns None rather than {}.
As both None & {} evaluates to false, 'if not data:' will give the
correct behaviour regardless of returning {} or None.
2016-06-30 16:53:35 +02:00
Enix Yu 8bb765a2da fix update/create/delete file api return value issue 2016-06-27 10:04:17 +08:00
Enix Yu a7929ac5c4 fix typo 2016-06-27 09:56:39 +08:00
Enix Yu 19f4d0af30 Merge branch 'master' of https://github.com/enix223/PyGithub 2016-06-27 09:53:29 +08:00
Enix Yu a0a4511f29 fix update/delete/create content return value invalid issue 2016-06-27 09:52:11 +08:00