Skip to content

Commit

Permalink
Fix tests on Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Dec 31, 2022
1 parent 57226b4 commit 2e5430f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# Python version, because typing sometimes changed between bugfix releases.
# For available versions, see:
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
python-version: ["3.7", "3.7.1", "3.8", "3.8.0", "3.9", "3.9.0", "3.10", "3.10.0", "3.11-dev", "pypy3.9"]
python-version: ["3.7", "3.7.1", "3.8", "3.8.0", "3.9", "3.9.0", "3.10", "3.10.0", "3.11", "3.11.0", "3.12-dev", "pypy3.9"]

runs-on: ubuntu-20.04

Expand All @@ -31,7 +31,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Test typing_extensions
continue-on-error: ${{ matrix.python-version == '3.11-dev' }}
continue-on-error: ${{ matrix.python-version == '3.12-dev' }}
run: |
# Be wary of running `pip install` here, since it becomes easy for us to
# accidentally pick up typing_extensions as installed by a dependency
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Release 4.4.1 (?)
# Unreleased

- Add better default value for TypeVar `default` parameter, PEP 696. Enables
runtime check if `None` was passed as default. Patch by Marc Mueller (@cdce8p).
- The `@typing_extensions.override` decorator now sets the `.__override__`
attribute. Patch by Steven Troxler.
- Fix `get_type_hints()` on cross-module inherited `TypedDict` in 3.9 and 3.10.
Patch by Carl Meyer.
- Add `frozen_default` parameter on `dataclass_transform`. Patch by Erik De Bonte.

# Release 4.4.0 (October 6, 2022)

Expand Down
1 change: 1 addition & 0 deletions src/test_typing_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3140,6 +3140,7 @@ def test_all_names_in___all__(self):

def test_typing_extensions_defers_when_possible(self):
exclude = {
'dataclass_transform',
'overload',
'ParamSpec',
'Text',
Expand Down
3 changes: 2 additions & 1 deletion src/typing_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,8 @@ def int_or_str(arg: int | str) -> None:
raise AssertionError("Expected code to be unreachable")


if hasattr(typing, 'dataclass_transform'):
if sys.version_info >= (3, 12):
# dataclass_transform exists in 3.11 but lacks the frozen_default parameter
dataclass_transform = typing.dataclass_transform
else:
def dataclass_transform(
Expand Down

0 comments on commit 2e5430f

Please sign in to comment.