Bug 2477406 - python-typing-extensions fails to build with Python 3.15: AssertionError: 'typing.Unpack[~Ts]' != 'typing.Unpack[Ts]' and TypeError: bad operand type for unary ~: 'typing.TypeVarTuple'
Summary: python-typing-extensions fails to build with Python 3.15: AssertionError: 'ty...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-typing-extensions
Version: 45
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jonny Heggheim
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.15
TreeView+ depends on / blocked
 
Reported: 2026-05-14 09:21 UTC by Karolina Surma
Modified: 2026-08-25 07:28 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2026-08-25 07:28:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github python typing_extensions issues 759 0 None open Unit tests fails on Python 3.15.0b1 2026-05-29 09:37:13 UTC

Description Karolina Surma 2026-05-14 09:21:04 UTC
python-typing-extensions fails to build with Python 3.15.0b1.

+ /usr/bin/python3 -m unittest discover
======================================================================
ERROR: test_annotation_and_optional_default (test_typing_extensions.GetTypeHintTests.test_annotation_and_optional_default) (annotation='typing.Unpack[~Ts]', as_str=True, wrap_optional=False, none_default=False, expected_type_hints={'x': typing.Unpack[~Ts]})
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-typing-extensions-4.15.0-build/typing_extensions-4.15.0/src/test_typing_extensions.py", line 1794, in test_annotation_and_optional_default
    type_hints = get_type_hints(func, globals(), locals(), include_extras=True)
  File "/usr/lib64/python3.15/typing.py", line 2503, in get_type_hints
    value = _eval_type(value, globalns, localns, (), format=format, owner=obj, prefer_fwd_module=True)
  File "/usr/lib64/python3.15/typing.py", line 475, in _eval_type
    return evaluate_forward_ref(t, globals=globalns, locals=localns,
                                type_params=type_params, owner=owner,
                                _recursive_guard=recursive_guard, format=format)
  File "/usr/lib64/python3.15/typing.py", line 1041, in evaluate_forward_ref
    value = forward_ref.evaluate(globals=globals, locals=locals,
                                 type_params=type_params, owner=owner, format=format)
  File "/usr/lib64/python3.15/annotationlib.py", line 207, in evaluate
    return eval(code, globals=globals, locals=locals)
  File "<string>", line 1, in <module>
TypeError: bad operand type for unary ~: 'typing.TypeVarTuple'

======================================================================
ERROR: test_annotation_and_optional_default (test_typing_extensions.GetTypeHintTests.test_annotation_and_optional_default) (annotation='typing.Unpack[~Ts] | None', as_str=True, wrap_optional=True, none_default=False, expected_type_hints={'x': typing.Unpack[~Ts] | None})
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-typing-extensions-4.15.0-build/typing_extensions-4.15.0/src/test_typing_extensions.py", line 1794, in test_annotation_and_optional_default
    type_hints = get_type_hints(func, globals(), locals(), include_extras=True)
  File "/usr/lib64/python3.15/typing.py", line 2503, in get_type_hints
    value = _eval_type(value, globalns, localns, (), format=format, owner=obj, prefer_fwd_module=True)
  File "/usr/lib64/python3.15/typing.py", line 475, in _eval_type
    return evaluate_forward_ref(t, globals=globalns, locals=localns,
                                type_params=type_params, owner=owner,
                                _recursive_guard=recursive_guard, format=format)
  File "/usr/lib64/python3.15/typing.py", line 1041, in evaluate_forward_ref
    value = forward_ref.evaluate(globals=globals, locals=locals,
                                 type_params=type_params, owner=owner, format=format)
  File "/usr/lib64/python3.15/annotationlib.py", line 207, in evaluate
    return eval(code, globals=globals, locals=locals)
  File "<string>", line 1, in <module>
TypeError: bad operand type for unary ~: 'typing.TypeVarTuple'

======================================================================
ERROR: test_annotation_and_optional_default (test_typing_extensions.GetTypeHintTests.test_annotation_and_optional_default) (annotation='typing.Unpack[~Ts]', as_str=True, wrap_optional=False, none_default=True, expected_type_hints={'x': typing.Unpack[~Ts]})
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-typing-extensions-4.15.0-build/typing_extensions-4.15.0/src/test_typing_extensions.py", line 1794, in test_annotation_and_optional_default
    type_hints = get_type_hints(func, globals(), locals(), include_extras=True)
  File "/usr/lib64/python3.15/typing.py", line 2503, in get_type_hints
    value = _eval_type(value, globalns, localns, (), format=format, owner=obj, prefer_fwd_module=True)
  File "/usr/lib64/python3.15/typing.py", line 475, in _eval_type
    return evaluate_forward_ref(t, globals=globalns, locals=localns,
                                type_params=type_params, owner=owner,
                                _recursive_guard=recursive_guard, format=format)
  File "/usr/lib64/python3.15/typing.py", line 1041, in evaluate_forward_ref
    value = forward_ref.evaluate(globals=globals, locals=locals,
                                 type_params=type_params, owner=owner, format=format)
  File "/usr/lib64/python3.15/annotationlib.py", line 207, in evaluate
    return eval(code, globals=globals, locals=locals)
  File "<string>", line 1, in <module>
TypeError: bad operand type for unary ~: 'typing.TypeVarTuple'

======================================================================
ERROR: test_annotation_and_optional_default (test_typing_extensions.GetTypeHintTests.test_annotation_and_optional_default) (annotation='typing.Unpack[~Ts] | None', as_str=True, wrap_optional=True, none_default=True, expected_type_hints={'x': typing.Unpack[~Ts] | None})
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-typing-extensions-4.15.0-build/typing_extensions-4.15.0/src/test_typing_extensions.py", line 1794, in test_annotation_and_optional_default
    type_hints = get_type_hints(func, globals(), locals(), include_extras=True)
  File "/usr/lib64/python3.15/typing.py", line 2503, in get_type_hints
    value = _eval_type(value, globalns, localns, (), format=format, owner=obj, prefer_fwd_module=True)
  File "/usr/lib64/python3.15/typing.py", line 475, in _eval_type
    return evaluate_forward_ref(t, globals=globalns, locals=localns,
                                type_params=type_params, owner=owner,
                                _recursive_guard=recursive_guard, format=format)
  File "/usr/lib64/python3.15/typing.py", line 1041, in evaluate_forward_ref
    value = forward_ref.evaluate(globals=globals, locals=locals,
                                 type_params=type_params, owner=owner, format=format)
  File "/usr/lib64/python3.15/annotationlib.py", line 207, in evaluate
    return eval(code, globals=globals, locals=locals)
  File "<string>", line 1, in <module>
TypeError: bad operand type for unary ~: 'typing.TypeVarTuple'

======================================================================
FAIL: test_cannot_set_attributes (test_typing_extensions.TypeAliasTypeTests.test_cannot_set_attributes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-typing-extensions-4.15.0-build/typing_extensions-4.15.0/src/test_typing_extensions.py", line 8032, in test_cannot_set_attributes
    with self.assertRaisesRegex(
         ~~~~~~~~~~~~~~~~~~~~~~^
        AttributeError,
        ^^^^^^^^^^^^^^^
        "attribute '__module__' of 'typing.TypeAliasType' objects is not writable",
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ):
    ^
AssertionError: AttributeError not raised

======================================================================
FAIL: test_repr (test_typing_extensions.TypeVarTupleTests.test_repr)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-typing-extensions-4.15.0-build/typing_extensions-4.15.0/src/test_typing_extensions.py", line 6557, in test_repr
    self.assertEqual(repr(Ts), 'Ts')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
AssertionError: '~Ts' != 'Ts'
- ~Ts
? -
+ Ts


======================================================================
FAIL: test_repr (test_typing_extensions.UnpackTests.test_repr)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-typing-extensions-4.15.0-build/typing_extensions-4.15.0/src/test_typing_extensions.py", line 6399, in test_repr
    self.assertEqual(repr(Unpack[Ts]), f'{Unpack.__module__}.Unpack[Ts]')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'typing.Unpack[~Ts]' != 'typing.Unpack[Ts]'
- typing.Unpack[~Ts]
?               -
+ typing.Unpack[Ts]



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

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

For all our attempts to build python-typing-extensions with Python 3.15, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/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.15:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/

Let us know here if you have any questions.

Python 3.15 is planned to be included in Fedora 45.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.15.
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 Karolina Surma 2026-05-14 09:33:22 UTC
test_cannot_set_attributes is mitigated with https://github.com/python/typing_extensions/commit/2f064147ff8b1eca7e169adf3a61d9cfc95f9276

Comment 2 Karolina Surma 2026-05-14 09:48:37 UTC
And this: https://github.com/python/typing_extensions/pull/741 should handle the rest, once it's finished.

Comment 3 Karolina Surma 2026-05-14 10:15:58 UTC
a WIP "fix" using the commits above, not intended to merge before the rebuild/proper fix: https://src.fedoraproject.org/rpms/python-typing-extensions/pull-request/28

Comment 4 Jonny Heggheim 2026-05-29 09:37:14 UTC
Reported upstream

Comment 5 Aoife Moloney 2026-08-17 14:39:45 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 45 development cycle.
Changing version to 45.

Comment 6 Ben Beasley 2026-08-25 07:28:19 UTC
The temporary fix was merged before the Python 3.15 mass rebuild, and then a proper fix appeared upstream in 4.16.0.


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