From 095313609ee17e7cae712883e5530803340f05d4 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 16 May 2024 15:39:53 -0400 Subject: [PATCH 1/3] Prepare release 4.12.0rc1 --- CHANGELOG.md | 65 ++++++++++++++++++++++++++++++-------------------- pyproject.toml | 2 +- 2 files changed, 40 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0e2530e..082caab5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,29 +1,37 @@ -# Release 4.12.0a1 and 4.12.0a2 - -These releases primarily test a revised release workflow. If all goes -well, release 4.12.0rc1 will follow soon. - -- Backport the `typing.NoDefault` sentinel object from Python 3.13. - TypeVars, ParamSpecs and TypeVarTuples without default values now have - their `__default__` attribute set to this sentinel value. -- TypeVars, ParamSpecs and TypeVarTuples now have a `has_default()` - method, matching `typing.TypeVar`, `typing.ParamSpec` and - `typing.TypeVarTuple` on Python 3.13+. -- TypeVars, ParamSpecs and TypeVarTuples with `default=None` passed to - their constructors now have their `__default__` attribute set to `None` - at runtime rather than `types.NoneType`. -- Fix most tests for `TypeVar`, `ParamSpec` and `TypeVarTuple` on Python - 3.13.0b1 and newer. -- Backport CPython PR [#118774](https://github.com/python/cpython/pull/118774), - allowing type parameters without default values to follow those with - default values in some type parameter lists. Patch by Alex Waygood, - backporting a CPython PR by Jelle Zijlstra. -- It is now disallowed to use a `TypeVar` with a default value after a - `TypeVarTuple` in a type parameter list. This matches the CPython - implementation of PEP 696 on Python 3.13+. -- Fix bug in PEP-696 implementation where default values for `ParamSpec`s - would be cast to tuples if a list was provided as the default value. - Patch by Alex Waygood. +# Release 4.12.0rc1 (May 16, 2024) + +This release focuses on compatibility with the upcoming release of +Python 3.13. Most changes are related to the implementation of type +parameter defaults (PEP 696). + +Thanks to all of the people who contributed patches, especially Alex +Waygood, who did most of the work adapting typing-extensions to the +CPython PEP 696 implementation. + +Full changelog: + +- Improve the implementation of type parameter defaults (PEP 696) + - Backport the `typing.NoDefault` sentinel object from Python 3.13. + TypeVars, ParamSpecs and TypeVarTuples without default values now have + their `__default__` attribute set to this sentinel value. + - TypeVars, ParamSpecs and TypeVarTuples now have a `has_default()` + method, matching `typing.TypeVar`, `typing.ParamSpec` and + `typing.TypeVarTuple` on Python 3.13+. + - TypeVars, ParamSpecs and TypeVarTuples with `default=None` passed to + their constructors now have their `__default__` attribute set to `None` + at runtime rather than `types.NoneType`. + - Fix most tests for `TypeVar`, `ParamSpec` and `TypeVarTuple` on Python + 3.13.0b1 and newer. + - Backport CPython PR [#118774](https://github.com/python/cpython/pull/118774), + allowing type parameters without default values to follow those with + default values in some type parameter lists. Patch by Alex Waygood, + backporting a CPython PR by Jelle Zijlstra. + - It is now disallowed to use a `TypeVar` with a default value after a + `TypeVarTuple` in a type parameter list. This matches the CPython + implementation of PEP 696 on Python 3.13+. + - Fix bug in PEP-696 implementation where default values for `ParamSpec`s + would be cast to tuples if a list was provided as the default value. + Patch by Alex Waygood. - Fix `Protocol` tests on Python 3.13.0a6 and newer. 3.13.0a6 adds a new `__static_attributes__` attribute to all classes in Python, which broke some assumptions made by the implementation of @@ -47,6 +55,11 @@ well, release 4.12.0rc1 will follow soon. 3.13+. - Backport `types.CapsuleType` from Python 3.13. +# Release 4.12.0a1 and 4.12.0a2 (May 16, 2024) + +These releases primarily test a revised release workflow. If all goes +well, release 4.12.0rc1 will follow soon. + # Release 4.11.0 (April 5, 2024) This feature release provides improvements to various recently diff --git a/pyproject.toml b/pyproject.toml index d829337d..3b9ae5a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "flit_core.buildapi" # Project metadata [project] name = "typing_extensions" -version = "4.12.0a2" +version = "4.12.0rc1" description = "Backported and Experimental Type Hints for Python 3.8+" readme = "README.md" requires-python = ">=3.8" From adc94b179437fc8790cde3e6b43ad96f2e9f160e Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 16 May 2024 15:41:39 -0400 Subject: [PATCH 2/3] Add new releases --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 082caab5..c333e203 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ Full changelog: `typing.ContextManager` and `typing.AsyncContextManager` on Python 3.13+. - Backport `types.CapsuleType` from Python 3.13. +- Releases are now made using [Trusted Publishers](https://docs.pypi.org/trusted-publishers/), improving the security of the release process. Patch by Jelle Zijlstra. # Release 4.12.0a1 and 4.12.0a2 (May 16, 2024) From b8bd41d964b813b8662fb4e1e9074f5f8f276b55 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 16 May 2024 15:48:57 -0400 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Alex Waygood --- CHANGELOG.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c333e203..d1ac543b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,8 +29,8 @@ Full changelog: - It is now disallowed to use a `TypeVar` with a default value after a `TypeVarTuple` in a type parameter list. This matches the CPython implementation of PEP 696 on Python 3.13+. - - Fix bug in PEP-696 implementation where default values for `ParamSpec`s - would be cast to tuples if a list was provided as the default value. + - Fix bug in PEP-696 implementation where a default value for a `ParamSpec` + would be cast to a tuple if a list was provided. Patch by Alex Waygood. - Fix `Protocol` tests on Python 3.13.0a6 and newer. 3.13.0a6 adds a new `__static_attributes__` attribute to all classes in Python, @@ -54,7 +54,8 @@ Full changelog: `typing.ContextManager` and `typing.AsyncContextManager` on Python 3.13+. - Backport `types.CapsuleType` from Python 3.13. -- Releases are now made using [Trusted Publishers](https://docs.pypi.org/trusted-publishers/), improving the security of the release process. Patch by Jelle Zijlstra. +- Releases are now made using [Trusted Publishers](https://docs.pypi.org/trusted-publishers/) + improving the security of the release process. Patch by Jelle Zijlstra. # Release 4.12.0a1 and 4.12.0a2 (May 16, 2024)