From ba94a8efcb72d9d69d26c8d7edeee208083656f4 Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Thu, 10 Aug 2023 10:26:20 +0300 Subject: [PATCH] Drop Python 3.7 support in the SDK and CLI (#6636) Drop python 3.7 support due to eol --- cvat-cli/setup.py | 2 +- cvat-sdk/cvat_sdk/auto_annotation/interface.py | 3 +-- cvat-sdk/cvat_sdk/core/proxies/model_proxy.py | 3 ++- cvat-sdk/cvat_sdk/core/utils.py | 3 +-- cvat-sdk/cvat_sdk/pytorch/transforms.py | 3 +-- cvat-sdk/gen/generator-config.yml | 2 +- site/content/en/docs/api_sdk/cli/_index.md | 2 +- site/content/en/docs/api_sdk/sdk/_index.md | 2 +- 8 files changed, 9 insertions(+), 11 deletions(-) diff --git a/cvat-cli/setup.py b/cvat-cli/setup.py index 58567b65e3d..454ce2f0095 100644 --- a/cvat-cli/setup.py +++ b/cvat-cli/setup.py @@ -56,7 +56,7 @@ def parse_requirements(filename=BASE_REQUIREMENTS_FILE): "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], - python_requires=">=3.7", + python_requires=">=3.8", install_requires=BASE_REQUIREMENTS, entry_points={ "console_scripts": [ diff --git a/cvat-sdk/cvat_sdk/auto_annotation/interface.py b/cvat-sdk/cvat_sdk/auto_annotation/interface.py index 160d12533d6..67313a7da6e 100644 --- a/cvat-sdk/cvat_sdk/auto_annotation/interface.py +++ b/cvat-sdk/cvat_sdk/auto_annotation/interface.py @@ -3,11 +3,10 @@ # SPDX-License-Identifier: MIT import abc -from typing import List, Sequence +from typing import List, Protocol, Sequence import attrs import PIL.Image -from typing_extensions import Protocol import cvat_sdk.models as models diff --git a/cvat-sdk/cvat_sdk/core/proxies/model_proxy.py b/cvat-sdk/cvat_sdk/core/proxies/model_proxy.py index 9f71fdd9365..9a761771af7 100644 --- a/cvat-sdk/cvat_sdk/core/proxies/model_proxy.py +++ b/cvat-sdk/cvat_sdk/core/proxies/model_proxy.py @@ -13,6 +13,7 @@ Dict, Generic, List, + Literal, Optional, Tuple, Type, @@ -21,7 +22,7 @@ overload, ) -from typing_extensions import Literal, Self +from typing_extensions import Self from cvat_sdk.api_client.model_utils import IModelData, ModelNormal, to_json from cvat_sdk.core.helpers import get_paginated_collection diff --git a/cvat-sdk/cvat_sdk/core/utils.py b/cvat-sdk/cvat_sdk/core/utils.py index e7c28e90e9f..1708dfd5779 100644 --- a/cvat-sdk/cvat_sdk/core/utils.py +++ b/cvat-sdk/cvat_sdk/core/utils.py @@ -14,14 +14,13 @@ ContextManager, Dict, Iterator, + Literal, Sequence, TextIO, Union, overload, ) -from typing_extensions import Literal - def filter_dict( d: Dict[str, Any], *, keep: Sequence[str] = None, drop: Sequence[str] = None diff --git a/cvat-sdk/cvat_sdk/pytorch/transforms.py b/cvat-sdk/cvat_sdk/pytorch/transforms.py index d63fdba65f6..1fb99362def 100644 --- a/cvat-sdk/cvat_sdk/pytorch/transforms.py +++ b/cvat-sdk/cvat_sdk/pytorch/transforms.py @@ -2,13 +2,12 @@ # # SPDX-License-Identifier: MIT -from typing import FrozenSet +from typing import FrozenSet, TypedDict import attrs import attrs.validators import torch import torch.utils.data -from typing_extensions import TypedDict from cvat_sdk.datasets.common import UnsupportedDatasetError from cvat_sdk.pytorch.common import Target diff --git a/cvat-sdk/gen/generator-config.yml b/cvat-sdk/gen/generator-config.yml index 80bc80a5e4f..26e78cb8a3a 100644 --- a/cvat-sdk/gen/generator-config.yml +++ b/cvat-sdk/gen/generator-config.yml @@ -4,7 +4,7 @@ additionalProperties: packageName: "cvat_sdk.api_client" initRequiredVars: true generateSourceCodeOnly: false - generatorLanguageVersion: '>=3.7' + generatorLanguageVersion: '>=3.8' globalProperties: generateAliasAsModel: true apiTests: false diff --git a/site/content/en/docs/api_sdk/cli/_index.md b/site/content/en/docs/api_sdk/cli/_index.md index 83b4b269219..0b7beb67eb1 100644 --- a/site/content/en/docs/api_sdk/cli/_index.md +++ b/site/content/en/docs/api_sdk/cli/_index.md @@ -30,7 +30,7 @@ To install an [official release of CVAT CLI](https://pypi.org/project/cvat-cli/) pip install cvat-cli ``` -We support Python versions 3.7 - 3.9. +We support Python versions 3.8 and higher. ## Usage diff --git a/site/content/en/docs/api_sdk/sdk/_index.md b/site/content/en/docs/api_sdk/sdk/_index.md index eca76659b90..025130ba396 100644 --- a/site/content/en/docs/api_sdk/sdk/_index.md +++ b/site/content/en/docs/api_sdk/sdk/_index.md @@ -44,7 +44,7 @@ To use the PyTorch adapter, request the `pytorch` extra: pip install "cvat-sdk[pytorch]" ``` -We support Python versions 3.7 - 3.9. +We support Python versions 3.8 and higher. ## Usage