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

Fix tests on Python 3.11 #106

Merged
merged 1 commit into from Dec 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
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
@@ -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
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
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