Fedora Account System
Red Hat Associate
Red Hat Customer
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.
test_cannot_set_attributes is mitigated with https://github.com/python/typing_extensions/commit/2f064147ff8b1eca7e169adf3a61d9cfc95f9276
And this: https://github.com/python/typing_extensions/pull/741 should handle the rest, once it's finished.
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
Reported upstream
This bug appears to have been reported against 'rawhide' during the Fedora Linux 45 development cycle. Changing version to 45.
The temporary fix was merged before the Python 3.15 mass rebuild, and then a proper fix appeared upstream in 4.16.0.