Skip to content
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

Add typing_extensions.evaluate_forward_ref #488

Open
befeleme opened this issue Oct 22, 2024 · 2 comments · May be fixed by #497
Open

Add typing_extensions.evaluate_forward_ref #488

befeleme opened this issue Oct 22, 2024 · 2 comments · May be fixed by #497

Comments

@befeleme
Copy link

We're building typing_extensions 4.12.2 with Python 3.14.0a1 in Fedora Linux. Unittests fail during the build:

+ /usr/bin/python3 -m unittest discover
.F................................................................................................................................................................s..s..s........................................................................................................................................................................................s.........................................s.s...............................s........
======================================================================
FAIL: test_drop_in_for_typing (test_typing_extensions.AllTests.test_drop_in_for_typing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-typing-extensions-4.12.2-build/typing_extensions-4.12.2/src/test_typing_extensions.py", line 5747, in test_drop_in_for_typing
    self.assertGreaterEqual(te_all, t_all - exceptions)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: {'final', 'SupportsComplex', 'TYPE_CHECKING', 'Generator', 'Dict', 'Required', 'MutableSequence', 'cast', 'no_type_check_decorator', 'OrderedDict', 'ParamSpec', 'ChainMap', 'Collection', 'Deque', 'Container', 'clear_overloads', 'IO', 'NotRequired', 'NoReturn', 'NamedTuple', 'LiteralString', 'Set', 'Self', 'Awaitable', 'MutableSet', 'AsyncGenerator', 'TypeIs', 'Literal', 'Mapping', 'Iterator', 'DefaultDict', 'ClassVar', 'ParamSpecArgs', 'MutableMapping', 'CapsuleType', 'get_origin', 'ValuesView', 'is_typeddict', 'Match', 'SupportsFloat', 'TextIO', 'Doc', 'get_type_hints', 'Final', 'NewType', 'TypeAliasType', 'Reversible', 'FrozenSet', 'Never', 'AsyncContextManager', 'Hashable', 'get_args', 'ReadOnly', 'runtime', 'BinaryIO', 'TypeVar', 'Sized', 'IntVar', 'Optional', 'AsyncIterator', 'Any', 'ItemsView', 'Coroutine', 'MappingView', 'KeysView', 'is_protocol', 'get_overloads', 'Annotated', 'AnyStr', 'NoDefault', 'dataclass_transform', 'Buffer', 'TypeAlias', 'get_protocol_members', 'SupportsBytes', 'overload', 'Sequence', 'Unpack', 'AbstractSet', 'reveal_type', 'ParamSpecKwargs', 'SupportsAbs', 'Text', 'SupportsIndex', 'Type', 'TypedDict', 'Counter', 'Union', 'Pattern', 'get_original_bases', 'Protocol', 'SupportsRound', 'TypeVarTuple', 'assert_never', 'List', 'Iterable', 'Concatenate', 'runtime_checkable', 'Tuple', 'TypeGuard', 'override', 'no_type_check', 'deprecated', 'AsyncIterable', 'ForwardRef', 'ContextManager', 'Callable', 'Generic', 'SupportsInt', 'assert_type'} not greater than or equal to {'final', 'SupportsComplex', 'AsyncContextManager', 'evaluate_forward_ref', 'TYPE_CHECKING', 'Hashable', 'Generator', 'get_args', 'ReadOnly', 'Dict', 'Required', 'MutableSequence', 'cast', 'BinaryIO', 'TypeVar', 'Sized', 'no_type_check_decorator', 'OrderedDict', 'Optional', 'ParamSpec', 'ChainMap', 'AsyncIterator', 'Any', 'ItemsView', 'Collection', 'Coroutine', 'MappingView', 'KeysView', 'is_protocol', 'get_overloads', 'Deque', 'Annotated', 'AnyStr', 'NoDefault', 'Container', 'clear_overloads', 'dataclass_transform', 'IO', 'NotRequired', 'NoReturn', 'TypeAlias', 'get_protocol_members', 'SupportsBytes', 'NamedTuple', 'LiteralString', 'Sequence', 'overload', 'AbstractSet', 'Set', 'Unpack', 'Awaitable', 'Self', 'reveal_type', 'SupportsAbs', 'ParamSpecKwargs', 'Text', 'MutableSet', 'AsyncGenerator', 'SupportsIndex', 'Type', 'TypeIs', 'Literal', 'Mapping', 'TypedDict', 'Union', 'Counter', 'Pattern', 'Protocol', 'Iterator', 'DefaultDict', 'ClassVar', 'ParamSpecArgs', 'MutableMapping', 'SupportsRound', 'get_origin', 'TypeVarTuple', 'assert_never', 'ValuesView', 'List', 'is_typeddict', 'Iterable', 'Match', 'Concatenate', 'SupportsFloat', 'runtime_checkable', 'Tuple', 'TypeGuard', 'TextIO', 'no_type_check', 'get_type_hints', 'override', 'Final', 'NewType', 'AsyncIterable', 'ForwardRef', 'ContextManager', 'TypeAliasType', 'Reversible', 'Callable', 'Generic', 'FrozenSet', 'Never', 'SupportsInt', 'assert_type'}
@JelleZijlstra
Copy link
Member

Looks like it's because the new typing.evaluate_forward_ref is not in typing_extensions. PR welcome to add it.

@JelleZijlstra JelleZijlstra changed the title [HEADS UP] test_drop_in_for_typing AssertionError with Python 3.14.0a1 Add typing_extensions.evaluate_forward_ref Oct 22, 2024
@hroncok
Copy link
Contributor

hroncok commented Oct 29, 2024

For reference, this was added to Python via python/cpython#119891

@Daraan Daraan linked a pull request Oct 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants