From 1d6ff84cbc8aa4f387062458ac3a5130064510da Mon Sep 17 00:00:00 2001 From: Vlad Emelianov Date: Thu, 9 Jan 2025 12:31:05 +0300 Subject: [PATCH] Rename Product enum values --- mypy_boto3_builder/chat/enums.py | 6 +- mypy_boto3_builder/cli_parser.py | 2 +- mypy_boto3_builder/debug.py | 2 +- mypy_boto3_builder/enums/product.py | 99 ++++++++++++++++------------- 4 files changed, 59 insertions(+), 50 deletions(-) diff --git a/mypy_boto3_builder/chat/enums.py b/mypy_boto3_builder/chat/enums.py index c30cd4c6..79e62aef 100644 --- a/mypy_boto3_builder/chat/enums.py +++ b/mypy_boto3_builder/chat/enums.py @@ -172,8 +172,8 @@ def product(self) -> Product: case Library.boto3: return Product.types_boto3_custom case Library.boto3_legacy: - return Product.boto3_custom + return Product.boto3_stubs_custom case Library.aiobotocore: - return Product.aiobotocore_custom + return Product.types_aiobotocore_custom case Library.aioboto3: - return Product.aioboto3_custom + return Product.types_aioboto3_custom diff --git a/mypy_boto3_builder/cli_parser.py b/mypy_boto3_builder/cli_parser.py index 4a334cd0..dfac0130 100644 --- a/mypy_boto3_builder/cli_parser.py +++ b/mypy_boto3_builder/cli_parser.py @@ -168,7 +168,7 @@ def parse_args(args: Sequence[str]) -> CLINamespace: action=EnumListAction, metavar="PRODUCT", nargs="+", - default=(Product.boto3, Product.boto3_services), + default=(Product.boto3_stubs, Product.boto3_stubs_services), help="Package to generate.", ) parser.add_argument( diff --git a/mypy_boto3_builder/debug.py b/mypy_boto3_builder/debug.py index 7451c813..b3824b56 100644 --- a/mypy_boto3_builder/debug.py +++ b/mypy_boto3_builder/debug.py @@ -22,7 +22,7 @@ def main() -> None: service_names=["acm"], build_version="1.0.0", output_types=[OutputType.package], - products=[Product.boto3_services], + products=[Product.boto3_stubs_services], list_services=False, partial_overload=False, skip_published=False, diff --git a/mypy_boto3_builder/enums/product.py b/mypy_boto3_builder/enums/product.py index 8685d403..a172681b 100644 --- a/mypy_boto3_builder/enums/product.py +++ b/mypy_boto3_builder/enums/product.py @@ -22,24 +22,24 @@ class Product(Enum): types_boto3_custom = "types-boto3-custom" types_boto3_docs = "types-boto3-docs" - aiobotocore = "aiobotocore" - aiobotocore_lite = "aiobotocore-lite" - aiobotocore_services = "aiobotocore-services" - aiobotocore_full = "aiobotocore-full" - aiobotocore_custom = "aiobotocore-custom" - aiobotocore_docs = "aiobotocore-docs" + types_aiobotocore = "aiobotocore" + types_aiobotocore_lite = "aiobotocore-lite" + types_aiobotocore_services = "aiobotocore-services" + types_aiobotocore_full = "aiobotocore-full" + types_aiobotocore_custom = "aiobotocore-custom" + types_aiobotocore_docs = "aiobotocore-docs" - aioboto3 = "aioboto3" - aioboto3_lite = "aioboto3-lite" - aioboto3_custom = "aioboto3-custom" - aioboto3_docs = "aioboto3-docs" + types_aioboto3 = "aioboto3" + types_aioboto3_lite = "aioboto3-lite" + types_aioboto3_custom = "aioboto3-custom" + types_aioboto3_docs = "aioboto3-docs" - boto3 = "boto3" - boto3_lite = "boto3-lite" - boto3_services = "boto3-services" - boto3_full = "boto3-full" - boto3_custom = "boto3-custom" - boto3_docs = "boto3-docs" + boto3_stubs = "boto3" + boto3_stubs_lite = "boto3-lite" + boto3_stubs_services = "boto3-services" + boto3_stubs_full = "boto3-full" + boto3_stubs_custom = "boto3-custom" + boto3_stubs_docs = "boto3-docs" def __str__(self) -> str: """ @@ -62,28 +62,28 @@ def get_library(self) -> ProductLibrary: ): return ProductLibrary.boto3 case ( - Product.boto3 - | Product.boto3_lite - | Product.boto3_services - | Product.boto3_full - | Product.boto3_docs - | Product.boto3_custom + Product.boto3_stubs + | Product.boto3_stubs_lite + | Product.boto3_stubs_services + | Product.boto3_stubs_full + | Product.boto3_stubs_docs + | Product.boto3_stubs_custom ): return ProductLibrary.boto3_legacy case ( - Product.aiobotocore - | Product.aiobotocore_lite - | Product.aiobotocore_services - | Product.aiobotocore_full - | Product.aiobotocore_docs - | Product.aiobotocore_custom + Product.types_aiobotocore + | Product.types_aiobotocore_lite + | Product.types_aiobotocore_services + | Product.types_aiobotocore_full + | Product.types_aiobotocore_docs + | Product.types_aiobotocore_custom ): return ProductLibrary.aiobotocore case ( - Product.aioboto3 - | Product.aioboto3_lite - | Product.aioboto3_docs - | Product.aioboto3_custom + Product.types_aioboto3 + | Product.types_aioboto3_lite + | Product.types_aioboto3_docs + | Product.types_aioboto3_custom ): return ProductLibrary.aioboto3 @@ -92,34 +92,43 @@ def get_type(self) -> ProductType: Get product type. """ match self: - case Product.types_boto3 | Product.boto3 | Product.aiobotocore | Product.aioboto3: + case ( + Product.types_boto3 + | Product.boto3_stubs + | Product.types_aiobotocore + | Product.types_aioboto3 + ): return ProductType.stubs case ( Product.types_boto3_lite - | Product.boto3_lite - | Product.aiobotocore_lite - | Product.aioboto3_lite + | Product.boto3_stubs_lite + | Product.types_aiobotocore_lite + | Product.types_aioboto3_lite ): return ProductType.stubs_lite case ( Product.types_boto3_services - | Product.boto3_services - | Product.aiobotocore_services + | Product.boto3_stubs_services + | Product.types_aiobotocore_services ): return ProductType.service_stubs case ( Product.types_boto3_docs - | Product.boto3_docs - | Product.aiobotocore_docs - | Product.aioboto3_docs + | Product.boto3_stubs_docs + | Product.types_aiobotocore_docs + | Product.types_aioboto3_docs ): return ProductType.docs - case Product.types_boto3_full | Product.boto3_full | Product.aiobotocore_full: + case ( + Product.types_boto3_full + | Product.boto3_stubs_full + | Product.types_aiobotocore_full + ): return ProductType.full case ( Product.types_boto3_custom - | Product.boto3_custom - | Product.aiobotocore_custom - | Product.aioboto3_custom + | Product.boto3_stubs_custom + | Product.types_aiobotocore_custom + | Product.types_aioboto3_custom ): return ProductType.custom