diff --git a/github/RateLimit.py b/github/RateLimit.py index 8886fc09..b134b755 100644 --- a/github/RateLimit.py +++ b/github/RateLimit.py @@ -30,6 +30,8 @@ import github.GithubObject import github.Rate +from deprecated import deprecated + class RateLimit(github.GithubObject.NonCompletableGithubObject): """ @@ -39,10 +41,25 @@ class RateLimit(github.GithubObject.NonCompletableGithubObject): def __repr__(self): return self.get__repr__({"core": self._core.value}) + @property + @deprecated(reason=""" + The rate object is deprecated. If you're writing new API client code + or updating existing code, you should use the core object instead of + the rate object. The core object contains the same information that + is present in the rate object. + """) + def rate(self): + """ + (Deprecated) Rate limit for non-search-related API, use `core` instead + + :type: class:`github.Rate.Rate` + """ + return self._core.value + @property def core(self): """ - Rate limit for rest of the API. + Rate limit for the non-search-related API :type: class:`github.Rate.Rate` """ @@ -51,7 +68,7 @@ class RateLimit(github.GithubObject.NonCompletableGithubObject): @property def search(self): """ - Rate limit for Search API. + Rate limit for the Search API. :type: class:`github.Rate.Rate` """ @@ -60,7 +77,7 @@ class RateLimit(github.GithubObject.NonCompletableGithubObject): @property def graphql(self): """ - Experimental rate limit for GraphQL, use with caution. + (Experimental) Rate limit for GraphQL API, use with caution. :type: class:`github.Rate.Rate` """ diff --git a/requirements.txt b/requirements.txt index 2e7444d8..8636b0c7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ requests>=2.14.0 pyjwt sphinx<1.8 -sphinx-rtd-theme<0.5 \ No newline at end of file +sphinx-rtd-theme<0.5 +Deprecated \ No newline at end of file diff --git a/setup.py b/setup.py index bb2a6350..d842400c 100755 --- a/setup.py +++ b/setup.py @@ -106,7 +106,8 @@ if __name__ == "__main__": python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", install_requires=[ "requests>=2.14.0", - "pyjwt" + "pyjwt", + "Deprecated" ], extras_require = { "integrations": ["cryptography"]