-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Third-party tests failed on Fri Oct 25 2024 #493
Comments
There's a chance this one is real |
A pydantic error on py312 and py313 that looks like it might have something to do with type aliases — could well be related to 139ac68 |
cc @Daraan in case you have time to look into it :-) |
Im already looking, but I am not very familiar with pydantic and do not see how the type statement is interpreted here. I'll look again in the next hours |
(@Daraan if it was caused by your change, this doesn't necessarily mean there was something wrong with your PR! Pydantic might be making an incorrect assumption somewhere. But we should at least try to track down the cause so that we can at least let them know before we make our next release :-) |
I now tested the first pydantic code in question in a new 3.12 & 3.13 environment and it also fails with the latest release. Edit: The There with comment:
|
I've now looked into it, this is an issue on the current pydantic v2.9.2 (2024-09-17) but with the changes from pydantic/pydantic#10369 the two statements that fail here pass without errors on 4.12.2 but not on the latest version. |
Hmm, I thought our third-party tests workflow ran pydantic's tests using the pydantic |
Today I learned Now the error is back with pydantic |
Finally, The problem in pydantic can be minimally written as this: from typing_extensions import TypeAliasType
type Int = int # creates typing.TypeAliasType
assert isinstance(Int, TypeAliasType) # fails I see two solutions:
The problem with 1) is that all 3rd party maintainers need to be aware of checking the two different versions. Possible solution with
|
I suspected it might be something like this. We have a warning about this kind of thing in our docs, but as you say, it's very easy for third-party libraries to forget to watch out for this footgun: https://typing-extensions.readthedocs.io/en/latest/#runtime-use-of-types I'm not sure your solution (2) is possible on the I don't think a solution doing something fancy with So we may need to patch this over at pydantic and loudly communicate the change in our changelog. |
Thanks for figuring this out! We already document at https://typing-extensions.readthedocs.io/en/latest/#runtime-use-of-types that you should always test both the typing and typing-extensions versions of types, even if they're currently the same. So pydantic should be changed to do so here; is anyone interested in sending an issue and/or a PR over to them to do so? |
Done, see pydantic Issue and PR draft. |
I recently refactored our typing inspection utilities, so we shouldn't get any new issues like these hopefully. |
Runs listed here: https://github.com/python/typing_extensions/actions/workflows/third_party.yml
The text was updated successfully, but these errors were encountered: