Use typing.overload for MainClass.get_user() since it can return two
disparate types. Correct the docstring for it, as well as locking down
Sphinx to <3 due to built docs issue and drive-by link correction.
Fixes#1550
The API endpoint Repository.get_workflows() calls returns data in a list
item, not directly, leading to some head scratching when calling it
against GitHub. Re-record the replay data.
To start supporting GitHub Actions, add the first part of that,
Workflow, which encapsulates a workflow over the API, along with
two methods on Repository to query them.
The function create_git_tag_and_release had no docstring, so it didn't
appear anywhere in our docs. Add a short one linking to the two methods
it calls.
Fixes#1402
Add a new class, Deployment to describe a deployment performed utilising
GitHub. Add three methods onto Repository to list them and create them.
Fixes#1117
Repository.create_git_tag_and_release() is a convience function that
creates a git tag and then a release. It was not passing the SHA1 of the
commit to the release function, resulting in incorrect releases.
Fixes#1336
The POST parameters passed to the create_project API call did not
consider the body optional, and always included it. Fix up a formatting
error in the docstring for good measure.
Fixes#1357
* Support for create_fork
http://developer.github.com/v3/repos/forks
* Add test case for create_fork
* Add param doc and fix extra line
* Specify the organization to increase line coverage
* Update test data
* Add type assert for organization param
Repository.get_contents() and Repository.get_dir_contents() call the
same endpoint, with slightly different error handling, and with the
difference that get_dir_contents() throws an odd exception if you call
it with a file. get_contents() already even handles being called for a
directory anyway, so deprecate get_dir_contents(), and refactor the code
so the tests pass.
Fixes#1283
If a byte object (for Python 3) was passed into either create_file or
update_file, it was attempted to be co-erced into a bytearray, which
failed. Check for encoded content before we encode it into bytes and
then base64 encode it.
Fixes#1266
* Jump from notifications to related PRs/issues.
* Add test case for jumping to related PRs/issues.
Also another method to get notifications scoped to a repository,
otherwise it's hard to keep out sensitive information from the test
cases.
* Add functions about automated security fixes and vulnerability alerts
* Refine methods and add unit test
* Add record
* Update record file - change user name
* Add get vulnerability alert function
* Fix typo
* Create file for testCreateFile
* Add tests
* Add unit test
* Simplify assert statement
Since the only part of the Legacy submodule that is used and tested is
the transform issue function, refactor it into a Repository method and
delete it.
Clean up a few errors I missed, ignore another, and configure flake8 using
a config file to ignore certain errors. The next step would be to remove
the F* ignores.
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!
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
Added support for the traffic endpoints found at https://developer.github.com/v3/repos/traffic/.
We added four functions to the Repository class (one for each of the endpoints) with corresponding unit tests.
Fixes#926
## Changes
- Add `affiliation` parameter to `get_collaborators()` and use it to filter collaborators through the API
- Resolves#937
PS: Would have loved to add a simple test for this but there seems to be a problem on my end using OAuth as I'm just not able to authenticate to the API during tests.
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.
* Add a trailing slash to URL when updating or deleting a file.
* Update test files to match new create/update/delete_file Repo methods
* Add trailing slash to get_contents() method
* update tests
* add missing slash in get_dir_contents
* add example usage
* remove dup slashes in tests
* clarify example comments
Initial solution for [PyGithub support for projects](https://github.com/PyGithub/PyGithub/issues/606) (#606). Adds comprehensive project querying API.
Currently does not support for modifying projects, columns or cards. (I only need this interface for reporting purposes. Of course once I'm done others are more than welcome to add additional features!)
API that was integrated:
https://developer.github.com/v3/projectshttps://developer.github.com/v3/projects/columnshttps://developer.github.com/v3/projects/cards
Note that the Github project API is in preview mode - it requires a special header in order for requests to be processed, and the API is subject to change without notice.
## Summary
- new classes: Project, ProjectColumn, ProjectCard
- add Organization.get_projects method
- add Repository.get_projects method
- add MainClass.get_project method
- add test cases to exercise all new classes and methods and verify attributes are as expected; replay data is included, recorded (mostly) from my fork of PyGithub
- updated add_attribute script to:
- use makeXXXAttribute API
- be able to add to the end of the current set of properties
- handle both Completable and NonCompletable class types correctly
## Checklist
Not to be merged until these are done:
- [x] remaining Project properties
- [x] remaining ProjectColumn properties
- [x] remaining ProjectCard properties
- [x] support for archived_state parameter when getting cards: all,archived, or not_archived
- [x] get issue from card, not just pull request ("get_content" method?)
- [x] centralize header management for "preview" access to projects API
- [x] add test for retrieving organization projects
- [x] add test for getting issue / pull request content from card