From 73fde969c4c1a57ad7b33458ed52d087face5c7c Mon Sep 17 00:00:00 2001 From: ludeeus Date: Sat, 21 Sep 2019 10:01:31 +0200 Subject: [PATCH] Fixes returnlimit for releases --- aiogithubapi/repository.py | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aiogithubapi/repository.py b/aiogithubapi/repository.py index 7d70630..611f0e9 100644 --- a/aiogithubapi/repository.py +++ b/aiogithubapi/repository.py @@ -138,7 +138,7 @@ async def get_rendered_contents(self, path, ref=None): @backoff.on_exception( backoff.expo, (ClientError, CancelledError, TimeoutError, KeyError), max_tries=5 ) - async def get_releases(self, prerelease=False): + async def get_releases(self, prerelease=False, returnlimit=5): """Retrun a list of repository release objects.""" endpoint = "/repos/{}/releases".format(self.full_name) url = BASE_URL + endpoint @@ -160,7 +160,7 @@ async def get_releases(self, prerelease=False): contents = [] for content in response: - if len(contents) == 5: + if len(contents) == returnlimit: break if not prerelease: if content.get("prerelease", False): diff --git a/setup.py b/setup.py index ccd68f6..28532a8 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setuptools.setup( name="aiogithubapi", - version="0.4.1", + version="0.4.2", author="Joakim Sorensen (@ludeeus)", author_email="hi@ludeeus.dev", description="Python async client for the GitHub API.",