⬆️ Upgrade dependency typing-extensions to ~4.8.0
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| typing-extensions (changelog) | ~4.5.0 -> ~4.8.0 |
Release Notes
python/typing_extensions (typing-extensions)
v4.8.0
No changes since 4.8.0rc1.
v4.7.1
- Fix support for
TypedDict,NamedTupleandis_protocolon PyPy-3.7 and PyPy-3.8. Patch by Alex Waygood. Note that PyPy-3.7 and PyPy-3.8 are unsupported by the PyPy project. The next feature release of typing-extensions will drop support for PyPy-3.7 and may also drop support for PyPy-3.8.
v4.7.0
- This is expected to be the last feature release supporting Python 3.7, which reaches its end of life on June 27, 2023. Version 4.8.0 will support only Python 3.8.0 and up.
- Fix bug where a
typing_extensions.Protocolclass that had one or more non-callable members would raiseTypeErrorwhenissubclass()was called against it, even if it defined a custom__subclasshook__method. The correct behaviour -- which has now been restored -- is not to raiseTypeErrorin these situations if a custom__subclasshook__method is defined. Patch by Alex Waygood (backporthttps://github.com/python/cpython/pull/105976l/105976).
v4.6.3
- Fix a regression introduced in v4.6.0 in the implementation of
runtime-checkable protocols. The regression meant
that doing
class Foo(X, typing_extensions.Protocol), whereXwas a class that hadabc.ABCMetaas its metaclass, would then cause subsequentisinstance(1, X)calls to erroneously raiseTypeError. Patch by Alex Waygood (backporting the CPythonhttps://github.com/python/cpython/pull/105152l/105152). - Sync the repository's LICENSE file with that of CPython.
typing_extensionsis distributed under the same license as CPython itself. - Skip a problematic test on Python 3.12.0b1. The test fails on 3.12.0b1 due to
a bug in CPython, which will be fixed in 3.12.0b2. The
typing_extensionstest suite now passes on 3.12.0b1.
v4.6.2
- Fix use of
@deprecatedon classes with__new__but no__init__. Patch by Jelle Zijlstra. - Fix regression in version 4.6.1 where comparing a generic class against a
runtime-checkable protocol using
isinstance()would causeAttributeErrorto be raised if using Python 3.7.
v4.6.1
- Change deprecated
@runtimeto formal API@runtime_checkablein the error message. Patch by Xuehai Pan. - Fix regression in 4.6.0 where attempting to define a
Protocolthat was generic over aParamSpecor aTypeVarTuplewould causeTypeErrorto be raised. Patch by Alex Waygood.
v4.6.0
-
typing_extensionsis now documented at https://typing-extensions.readthedocs.io/en/latest/. Patch by Jelle Zijlstra. -
Add
typing_extensions.Buffer, a marker class for buffer types, as proposed by PEP 688. Equivalent tocollections.abc.Bufferin Python 3.12. Patch by Jelle Zijlstra. -
Backport two CPython PRs fixing various issues with
typing.Literal: https://github.com/python/cpython/pull/232943294 https://github.com/python/cpython/pull/23383ll/23383. Both CPython PRs were originally by Yurii Karabas, and both were backported to Python >=3.9.1, but no earlier. Patch by Alex Waygood.A side effect of one of the changes is that equality comparisons of
Literalobjects will now raise aTypeErrorif one of theLiteralobjects being compared has a mutable parameter. (Using mutable parameters withLiteralis not supported by PEP 586 or by any major static type checkers.) -
Literalis now reimplemented on all Python versions <= 3.10.0. Thetyping_extensionsversion does not suffer from the bug that was fixed in https://github.com/python/cpython/pull/293349334. (The CPython bugfix was backported to CPython 3.10.1 and 3.9.8, but no earlier.) -
Backport CPython PR 26067 (originally by Yurii Karabas), ensuring that
isinstance()calls on protocols raiseTypeErrorwhen the protocol is not decorated with@runtime_checkable. Patch by Alex Waygood. -
Backport several significant performance improvements to runtime-checkable protocols that have been made in Python 3.12 (https://github.com/python/cpython/issues/74690es/74690 for details). Patch by Alex Waygood.
A side effect of one of the performance improvements is that the members of a runtime-checkable protocol are now considered “frozen” at runtime as soon as the class has been created. Monkey-patching attributes onto a runtime-checkable protocol will still work, but will have no impact on
isinstance()checks comparing objects to the protocol. See "What's New in Python 3.12" for more details. -
isinstance()checks against runtime-checkable protocols now useinspect.getattr_static()rather thanhasattr()to lookup whether attributes exist (backporthttps://github.com/python/cpython/pull/1030343034). This means that descriptors and__getattr__methods are no longer unexpectedly evaluated duringisinstance()checks against runtime-checkable protocols. However, it may also mean that some objects which used to be considered instances of a runtime-checkable protocol on older versions oftyping_extensionsmay no longer be considered instances of that protocol using the new release, and vice versa. Most users are unlikely to be affected by this change. Patch by Alex Waygood. -
Backport the ability to define
__init__methods on Protocol classes, a change made in Python 3.11 (originally implementedhttps://github.com/python/cpython/pull/31628ll/31628 by Adrian Garcia Badaracco). Patch by Alex Waygood. -
Speedup
isinstance(3, typing_extensions.SupportsIndex)by >10x on Python <3.12. Patch by Alex Waygood. -
Add
typing_extensionsversions ofSupportsInt,SupportsFloat,SupportsComplex,SupportsBytes,SupportsAbsandSupportsRound. These have the same semantics as the versions from thetypingmodule, butisinstance()checks against thetyping_extensionsversions are >10x faster at runtime on Python <3.12. Patch by Alex Waygood. -
Add
__orig_bases__to non-generic TypedDicts, call-based TypedDicts, and call-based NamedTuples. Other TypedDicts and NamedTuples already had the attribute. Patch by Adrian Garcia Badaracco. -
Add
typing_extensions.get_original_bases, a backport oftypes.get_original_bases, introduced in Python 3.12 (CPythonhttps://github.com/python/cpython/pull/101827l/101827, originally by James Hilton-Balfe). Patch by Alex Waygood.This function should always produce correct results when called on classes constructed using features from
typing_extensions. However, it may produce incorrect results when called on someNamedTupleorTypedDictclasses that usetyping.{NamedTuple,TypedDict}on Python <=3.11. -
Constructing a call-based
TypedDictusing keyword arguments for the fields now causes aDeprecationWarningto be emitted. This matches the behaviour oftyping.TypedDicton 3.11 and 3.12. -
Backport the implementation of
NewTypefrom 3.10 (where it is implemented as a class rather than a function). This allows user-definedNewTypes to be pickled. Patch by Alex Waygood. -
Fix tests and import on Python 3.12, where
typing.TypeVarcan no longer be subclassed. Patch by Jelle Zijlstra. -
Add
typing_extensions.TypeAliasType, a backport oftyping.TypeAliasTypefrom PEP 695. Patch by Jelle Zijlstra. -
Backport changes to the repr of
typing.Unpackthat were made in order to implement PEP 692 (backport of https://github.com/python/cpython/pull/1040484048). Patch by Alex Waygood.
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
Codecov Report
Patch and project coverage have no change.
Comparison is base (
3dca4d2) 100.00% compared to head (7b390c0) 100.00%.
Additional details and impacted files
@@ Coverage Diff @@
## main #119 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 182 182
=========================================
Hits 182 182
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
⚠ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
- any of the package files in this branch needs updating, or
- the branch becomes conflicted, or
- you click the rebase/retry checkbox if found above, or
- you rename this PR's title to start with "rebase!" to trigger it manually
The artifact failure details are included below:
File name: poetry.lock
installing v2 tool python v3.11.5
[04:42:14.884] INFO (9): Installing tool python v3.11.5...
linking tool python v3.11.5
Python 3.11.5
pip 23.2.1 from /opt/containerbase/tools/python/3.11.5/lib/python3.11/site-packages/pip (python 3.11)
[04:42:22.266] INFO (9): Installed tool python in 7.3s.
[04:42:23.136] INFO (170): Installing tool poetry v1.4.1...
installing v2 tool poetry v1.4.1
linking tool poetry v1.4.1
Poetry (version 1.4.1)
[04:42:34.360] INFO (170): Installed tool poetry in 11.2s.
Updating dependencies
Resolving dependencies...
Creating virtualenv otel-cli-g12qcMM0-py3.11 in /home/ubuntu/.cache/pypoetry/virtualenvs
The current project's Python requirement (>=3.7,<4.0) is not compatible with some of the required packages Python requirement:
- typing-extensions requires Python >=3.8, so it will not be satisfied for Python >=3.7,<3.8
Because typing-extensions (4.8.0) requires Python >=3.8
and no versions of typing-extensions match >4.8.0,<4.9.0, typing-extensions is forbidden.
So, because otel-cli depends on typing-extensions (~4.8.0), version solving failed.
• Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
For typing-extensions, a possible solution would be to set the `python` property to ">=3.8,<4.0"
https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
https://python-poetry.org/docs/dependency-specification/#using-environment-markers