The get_installation() method of GithubIntegration was hardcoded to
always use the default URL of api.github.com, making it impossible to
fetch the installation of an GitHub Enterprise installation.
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!
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#757Closes#860
#664 got rid of most of httplib and replaced it with requests.
This is the last place it was used. It makes a more coherent code base I think.
Tests are ok locally.
The return value of MainClass.search_topics() was a paginated list of
Repository, which is incorrect. Add a Topic class to encapuslate what is
returned.
Fixes#929
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.
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
MainClass.get_repo() used to default to lazy fetching, which is not what
NamedUser.get_repo() does, so change the default. Fix the tess to pass
lazy=True, so that we don't need to grow 8 ReplayData files with 11
lines of the repository in question.
Fixes#353
In the old code the self.__hostname would be overwritten with uploads.github.com
but it could not be correctly re-set to api.github.com after completing the upload
Create a separate connection if hostname or port differ in requestBlobAndCheck
in the end this became quite a large overhaul, to also make this change generic
for e.g. connecting to status.github.com and similar methods
~~not sure if tests need (more) updating, if so I will update the PR accordingly~~
* 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
This lets users do the following without issuing an unnecessary request:
issues_of_my_repository = g.get_repo('PyGithub/PyGithub').get_issues()
Since the GithubObject layer handles laziness transparently, lazy
loading is enabled by default, and can be disabled via the `lazy`
kwarg. This does not affect any test except tests that pertain to
caching or laziness itself.