Bug 2259519 - python-typing-extensions fails to build with Python 3.13: AttributeError: attribute '__default__' of 'typing.TypeVar' objects is not writable
Summary: python-typing-extensions fails to build with Python 3.13: AttributeError: att...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-typing-extensions
Version: rawhide
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
Assignee: Jonny Heggheim
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2024-01-22 08:21 UTC by Karolina Surma
Modified: 2024-05-29 08:35 UTC (History)
7 users (show)

Fixed In Version: python-typing-extensions-4.12.0-1.fc41
Clone Of:
Environment:
Last Closed: 2024-05-29 08:35:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github python typing_extensions issues 326 0 None open Unit tests fails with Python 3.13.0a2 2024-01-22 10:48:42 UTC
Github python typing_extensions issues 370 0 None open Unit tests fails on Python 3.13 for 4.11.0 2024-04-18 11:15:10 UTC

Description Karolina Surma 2024-01-22 08:21:58 UTC
python-typing-extensions fails to build with Python 3.13.0a2.

+ /usr/bin/python3 -m unittest discover
.......................................................................................................................................................s..s..s....................................................................F................................F...............................................................................................s........../builddir/build/BUILD/typing_extensions-4.9.0/src/test_typing_extensions.py:3507: DeprecationWarning: Failing to pass a value for the 'fields' parameter is deprecated and will be disallowed in Python 3.15. To create a TypedDict class with 0 fields using the functional syntax, pass an empty dictionary, e.g. `Emp = TypedDict('Emp', {})`.
  Emp = TypedDict('Emp', name=str, id=int)
...............s........
======================================================================
FAIL: test_generic_protocols_special_from_protocol (test_typing_extensions.ProtocolTests.test_generic_protocols_special_from_protocol)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/typing_extensions-4.9.0/src/test_typing_extensions.py", line 3061, in test_generic_protocols_special_from_protocol
    self.assertEqual(typing_extensions._get_protocol_attrs(PR), {'x'})
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Items in the first set but not the second:
'__non_callable_proto_members__'

======================================================================
FAIL: test_protocol_issubclass_error_message (test_typing_extensions.ProtocolTests.test_protocol_issubclass_error_message)
----------------------------------------------------------------------
TypeError: Instance and class checks can only be used with @runtime_checkable protocols

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/typing_extensions-4.9.0/src/test_typing_extensions.py", line 3471, in test_protocol_issubclass_error_message
    with self.assertRaisesRegex(TypeError, re.escape(expected_error_message)):
        issubclass(int, Vec2D)
AssertionError: "Protocols\ with\ non\-method\ members\ don't\ support\ issubclass\(\)\.\ Non\-method\ members:\ 'x',\ 'y'\." does not match "Instance and class checks can only be used with @runtime_checkable protocols"

----------------------------------------------------------------------
Ran 385 tests in 0.113s

FAILED (failures=2, skipped=5)

https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06924398-python-typing-extensions/

For all our attempts to build python-typing-extensions with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-typing-extensions/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Jonny Heggheim 2024-01-22 10:48:43 UTC
Reported issue upstream.

Comment 2 Jonny Heggheim 2024-01-22 10:56:46 UTC
Fixed by upstream https://github.com/python/typing_extensions/commit/004b893ddce2a5743d9a4de3a97ef5c48882d384 but not released yet

Comment 3 Aoife Moloney 2024-02-15 23:11:03 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.

Comment 4 Michel Lind 2024-04-17 01:09:38 UTC
Upstream said it's fixed in 4.10.0, interestingly the 4.11.0 build is the first that passed, and then immediately failed again. There might still be other test failures that needs addressing upstream.

Comment 5 Jonny Heggheim 2024-04-18 11:15:11 UTC
Added a new issue upstream

Comment 6 Jonny Heggheim 2024-04-18 11:21:04 UTC
Fixed in https://github.com/python/typing_extensions/pull/367 but it is not released yet

Comment 7 Miro Hrončok 2024-05-28 19:43:30 UTC
This is the current failure:



+ /usr/bin/python3 -m unittest discover
E
======================================================================
ERROR: test_typing_extensions (unittest.loader._FailedTest.test_typing_extensions)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_typing_extensions
Traceback (most recent call last):
  File "/usr/lib64/python3.13/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib64/python3.13/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/builddir/build/BUILD/typing_extensions-4.11.0/src/test_typing_extensions.py", line 1148, in <module>
    T_a = TypeVar('T_a')
  File "/builddir/build/BUILD/typing_extensions-4.11.0/src/typing_extensions.py", line 1418, in __new__
    _set_default(typevar, default)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/typing_extensions-4.11.0/src/typing_extensions.py", line 1375, in _set_default
    type_param.__default__ = None
    ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: attribute '__default__' of 'typing.TypeVar' objects is not writable


----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (errors=1)


-----

This package is critical in the Python stack, blocks setuptools_scm, pytest, transitively hundreds of packages. We need to patch it soon.

Comment 8 Karolina Surma 2024-05-29 05:50:03 UTC
Update to 4.12.0 should make it do: https://src.fedoraproject.org/rpms/python-typing-extensions/pull-request/14


Note You need to log in before you can comment on or make changes to this bug.