Skip to content

[Authlib] Add missing stubs #14368

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

Merged
merged 1 commit into from
Jul 7, 2025
Merged

Conversation

donBarbos
Copy link
Contributor

*I used ClassVar for uppercase attributes because these attributes are often overridden in child classes and Final doesn't allow that.

Copy link
Contributor

github-actions bot commented Jul 4, 2025

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau merged commit 3370aa6 into python:main Jul 7, 2025
49 checks passed
@pkit
Copy link

pkit commented Jul 8, 2025

It looks like this PR breaks mypy:

Cannot find implementation or library stub for module named "authlib.integrations.requests_client"

Works fine with types-authlib==1.5.2
Ah, I see all integrations are removed for some reason. Why?

@donBarbos
Copy link
Contributor Author

hmm, it's strange if this PR really leads to such consequences.

integrations stubs were not "removed" because they didn't exist anyway. they were just added to stuballow file to ignore errors associated with them.

if we add them, then errors will occur that stubtests can't import third-party library

@srittau
Copy link
Collaborator

srittau commented Jul 9, 2025

As @donBarbos pointed out, apart from base_client the integrations were never part of the types-Authlib package. Also, version 1.5.2 of the package doesn't exist (only 1.5.2.20250704) so types-authlib==1.5.2 shouldn't work. I just tried this myself, and I get your error message, both with the current 1.6.0.20250708 and with 1.5.2.20250704. So I'm not sure what exactly is going on.

That said, we would of course welcome any additions to our stubs that add (selected) integrations.

@pkit
Copy link

pkit commented Jul 9, 2025

It's 1.5.2.20250704 you're right.
So they were ignored before, and now are not ignored?
Just a simple test of importing:
from authlib.integrations.requests_client import OAuth2Session
Will fail to be type checked in the newest types-authlib
And was passing earlier.

@donBarbos
Copy link
Contributor Author

So they were ignored before, and now are not ignored?

The thing is that they were never part of type stubs at all.
"ignored" means that we don't want to receive messages from typeshed CI about the absence of these types. And they were ignored both before and now. So we can't figure out what could be wrong with your situation.

@srittau
Copy link
Collaborator

srittau commented Jul 10, 2025

Oh, now I see what could be the issue. We've removed the partial flag in this PR, although the stubs aren't complete. I still can't explain why I can't seem to reproduce this locally, but that was clearly an error and we need to restore that flag.

@pkit
Copy link

pkit commented Jul 10, 2025

% cat t.py 
from authlib.integrations.requests_client import OAuth2Session
% mypy t.py                   
t.py:1: error: Cannot find implementation or library stub for module named "authlib.integrations.requests_client"  [import-not-found]
t.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)
% pip freeze | grep -i authlib
Authlib==1.6.0
types-Authlib==1.6.0.20250708

Downgrading to 1.5.2.20250704 works fine

% pip freeze | grep mypy      
mypy==1.16.0
mypy_extensions==1.1.0

@srittau
Copy link
Collaborator

srittau commented Jul 10, 2025

@pkit Could you confirm that the problem has been fixed with types-Authlib==1.6.0.20250710?

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

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy