From d958e828c2330684aa686dcd6fc81aa3c7992c51 Mon Sep 17 00:00:00 2001 From: Maciej Urbanski Date: Tue, 25 Jul 2023 21:22:14 +0200 Subject: [PATCH] fix pydantic validation compatiblity Pydantic now requires typing_extensions use on all pre-3.12 Python versions. See https://github.com/pydantic/pydantic/pull/6370/files#diff-4b71c6b75773e0ee81bdfe8a88a4f2d4eb9eba8b0548ccb190a7a6adffec3d07R293-R294 for details. --- CHANGELOG.md | 3 +++ b2sdk/raw_api.py | 4 ++-- requirements.txt | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 853b82b74..99d62afe2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +* Require `typing_extensions` on Python 3.11 (already required on earlier versinons) for better compatibility with pydantic v2 + ## [1.22.1] - 2023-07-24 ### Fixed diff --git a/b2sdk/raw_api.py b/b2sdk/raw_api.py index 397454eb3..cd6302d1d 100644 --- a/b2sdk/raw_api.py +++ b/b2sdk/raw_api.py @@ -17,9 +17,9 @@ from typing import Any try: - from typing import NotRequired, TypedDict -except ImportError: from typing_extensions import NotRequired, TypedDict +except ImportError: + from typing import NotRequired, TypedDict from b2sdk.http_constants import FILE_INFO_HEADER_PREFIX from b2sdk.utils.docs import ensure_b2sdk_doc_urls diff --git a/requirements.txt b/requirements.txt index 8af58efe4..e99bd83ef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ importlib-metadata>=3.3.0; python_version < '3.8' logfury>=1.0.1,<2.0.0 requests>=2.9.1,<3.0.0 tqdm>=4.5.0,<5.0.0 -typing-extensions>=4.7.1; python_version < '3.11' +typing-extensions>=4.7.1; python_version < '3.12'