-
-
Notifications
You must be signed in to change notification settings - Fork 118
Fix most tests on Python 3.13 #378
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
Conversation
@JelleZijlstra any idea what's up with the (main) % ./python.exe ~/dev/cpython
Python 3.14.0a0 (heads/main:66f8bb76a1, May 8 2024, 17:00:15) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from typing import NoDefault
>>> import pickle
>>> pickle.dumps(NoDefault)
Traceback (most recent call last):
File "<python-input-2>", line 1, in <module>
pickle.dumps(NoDefault)
~~~~~~~~~~~~^^^^^^^^^^^
_pickle.PicklingError: can't pickle 'NoDefaultType' object: typing.NoDefault
>>> import typing
>>> pickle.dumps(typing.NoDefault)
Traceback (most recent call last):
File "<python-input-4>", line 1, in <module>
pickle.dumps(typing.NoDefault)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
_pickle.PicklingError: can't pickle 'NoDefaultType' object: typing.NoDefault What I don't understand is why the pickling tests are passing in the CPython test suite: https://github.com/python/cpython/blob/7ac933e2609b2ef9b08ccf9c815b682b0e1ede2a/Lib/test/test_typing.py#L10230-L10234 |
src/test_typing_extensions.py
Outdated
@skipIf( | ||
sys.version_info[:5] == (3, 13, 0, "beta", 1), | ||
"incorrectly raises TypeError in the first 3.13 beta" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened python/cpython#118895
The pickle thing is weird; I can reproduce it on CPython when I comment out the |
That is weird. I guess I'll skip the test over here for now. |
Found it:
The good news is that I think python/cpython#118897 fixes this. (Nikita just commented as much.) |
Alright, so just one failing test left now: ======================================================================
FAIL: test_async_contextmanager (test_typing_extensions.OtherABCTests.test_async_contextmanager)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/runner/work/typing_extensions/typing_extensions/src/test_typing_extensions.py", line 1652, in test_async_contextmanager
self.assertEqual(typing_extensions.AsyncContextManager[int].__args__, (int,))
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Tuples differ: (<class 'int'>, bool | None) != (<class 'int'>,)
First tuple contains 1 additional elements.
First extra element 1:
bool | None
- (<class 'int'>, bool | None)
+ (<class 'int'>,) The principled way of fixing that is to make |
Let's merge this now to fix a number of the tests; we can fix the rest separately. |
Thanks for fixing these! Currently, the |
If we cut a new release right now, it would break pydantic, which would be very bad (#381) -- we've broken pydantic before, and the experience was extremely chaotic for us, we definitely don't want to do it again 🙃 I've opened a PR to fix pydantic's tests with the |
Great! I'm watching pydantic/pydantic#9426 and keeping an eye out for new releases of |
typing_extensions 4.12.0rc1 is now out @erlend-aasland! :D https://pypi.org/project/typing-extensions/4.12.0rc1/ |
The final release should happen in a week (next Thursday). |
Helps with #377. Lots of changes to reflect changes in the PEP-696 implementation that were made upstream but had yet to be backported here.
There's still a couple of failing tests on Python 3.13 even with this PR, but this gets us a lot closer to a clean bill of health.