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

trio support broken: unexpected keyword argument 'auth_manager' #138

Open
burnpanck opened this issue Apr 18, 2024 · 3 comments
Open

trio support broken: unexpected keyword argument 'auth_manager' #138

burnpanck opened this issue Apr 18, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@burnpanck
Copy link

It appears that trio support is currently broken. The following basic example fails:

async with aiogoogle.Aiogoogle(
    session_factory=aiogoogle.sessions.trio_asks_session.TrioAsksSession,
) as gcp_api:
    storage = await gcp_api.discover("storage", "v1")

->

TypeError: TrioAsksSession.send() got an unexpected keyword argument 'auth_manager'

It looks like auth_manager is something requests-specific which potentially was just implemented recently?
This was tested under python 3.12.2 with the following versions:

  • trio: 0.24.0
  • aiogoogle: 5.7.0
  • asks: 3.0.0
@omarryhan
Copy link
Owner

Hi @burnpanck , It’s likely that support for Trio & Curio got broken. I’ve been only approving PRs and not actively maintaining the repo. Also, I didn’t feel like there’s much demand for loops outside asyncio. That’s why I wasn’t investing much in testing them.

But I’d say the changes since I last personally tested these 2 loop providers were minimal. So should be easy to patch. It would be amazing if you can help me with that! And I’ll do my best to approve and deploy your changes. Thanks!

@omarryhan omarryhan added the bug Something isn't working label Apr 18, 2024
@burnpanck
Copy link
Author

I didn’t feel like there’s much demand for loops outside asyncio.

People don't realise what they miss! With trio, I don't have a single exception that accidentally ends up on stderr. With asnycio, that happens all the time.

Anyway, I'm happy to help in this regard. What exactly is that auth_manager argument supposed to do? I was just trying to monkey-patch TrioAsksSession to accept that argument and simply assert auth_manager is None, but then I did run into other issues. It appears that asks is unmaintained, and fails to work with a recent trio. I'll probably just write a new session manager for httpx using anyio, doesn't look too complicated.

@omarryhan
Copy link
Owner

Yup, it’s not too complicated. But auth manager is important, it’s the object responsible for authenticating the requests being sent. @burnpanck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants