diff --git a/pontos/github/api/packages.py b/pontos/github/api/packages.py index 314971c61..ddd2932dd 100644 --- a/pontos/github/api/packages.py +++ b/pontos/github/api/packages.py @@ -118,17 +118,19 @@ async def package_versions( ) -> AsyncIterator[PackageVersion]: """ Get information about package versions - + + https://docs.github.com/en/rest/reference/packages#list-package-versions-for-an-organization - + + Args: organization: GitHub organization to use package_type: Type of the package to get package_name: Name of the package to get - + Raises: `httpx.HTTPStatusError`: If there was an error in the request - + Returns: An async iterator yielding package versions @@ -349,7 +351,9 @@ async def delete_package_with_tag( tag="latest", ) """ - async for package_version in self.package_versions(organization, package_type, package_name): + async for package_version in self.package_versions( + organization, package_type, package_name + ): if tag in package_version.tags: api = f"/orgs/{organization}/packages/{package_type}/{package_name}/versions/{package_version.id}" response = await self._client.delete(api) diff --git a/tests/github/api/test_packages.py b/tests/github/api/test_packages.py index eaabb30d9..4bd90e989 100644 --- a/tests/github/api/test_packages.py +++ b/tests/github/api/test_packages.py @@ -228,7 +228,7 @@ async def test_delete_package_with_tag(self): "/orgs/foo/packages/container/bar/versions/tags/latest" ) - async def test_package_versions(self): + async def test_package_versions(self): response1 = create_response() response1.json.return_value = [PACKAGE_VERSION] response2 = create_response()