Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aiohttp deprecation warnings and unpinned aiohttp package #168

Closed
vEpiphyte opened this issue Apr 28, 2020 · 1 comment
Closed

aiohttp deprecation warnings and unpinned aiohttp package #168

vEpiphyte opened this issue Apr 28, 2020 · 1 comment

Comments

@vEpiphyte
Copy link

Hi,

The aioauth-client is using aiohttp without the max version being pinned. This is potentially pretty unstable, since aioauth-client is also using deprecated apis.

The requirements.txt (used in setup.py)

aiohttp >= 3.0.0

Per
https://docs.aiohttp.org/en/stable/changes.html#deprecations-and-removals several of the timeout arguments used in aioauth-client are marked as deprecated and do raise DeprecationWarning notices. These are here https://github.com/klen/aioauth-client/blob/develop/aioauth_client.py#L147

    async def _request(self, method, url, loop=None, timeout=None, **kwargs):
        """Make a request through AIOHTTP."""
        session = self.session or aiohttp.ClientSession(
            loop=loop, conn_timeout=timeout, read_timeout=timeout, raise_for_status=True)
        try:
            async with session.request(method, url, **kwargs) as response:
                if 'json' in response.headers.get('CONTENT-TYPE'):
                    data = await response.json()
                else:
                    data = await response.text()
                    data = dict(parse_qsl(data)) or data

                return data

        except asyncio.TimeoutError:
            raise web.HTTPBadRequest(reason='HTTP Timeout')

        finally:
            if not self.session and not session.closed:
                await session.close()

These are slated to be removed in aiohttp 4.0.0 and once that package is released, aioauth-client users will be in a broken state due to the lack of maximum version pinning.

Can the maximum version be capped and/or the deprecated features be removed and replaced with a single timeout?

@klen
Copy link
Owner

klen commented Dec 30, 2020

Thank you. The latest version of the aioauth-client is not depending on aiohttp anymore.

@klen klen closed this as completed Dec 30, 2020
webknjaz pushed a commit to aio-libs/aiohttp that referenced this issue Jun 21, 2021
This library has changed its purpose and is now uses `httpx`, so it's no
longer compatible with `aiohttp`.

This is only clarified here: klen/aioauth-client#168
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants