Skip to content

Commit

Permalink
Rename Product enum values
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Jan 9, 2025
1 parent b4252e9 commit 1d6ff84
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 50 deletions.
6 changes: 3 additions & 3 deletions mypy_boto3_builder/chat/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion mypy_boto3_builder/cli_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion mypy_boto3_builder/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
99 changes: 54 additions & 45 deletions mypy_boto3_builder/enums/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand All @@ -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

Expand All @@ -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

0 comments on commit 1d6ff84

Please sign in to comment.