{"id":3676,"library":"mypy-boto3-proton","title":"mypy-boto3-proton Type Stubs","description":"Type annotations for boto3 Proton 1.42.3 service generated with mypy-boto3-builder 8.12.0. This library provides type stubs, not the actual `boto3` implementation, to enable static type checking for AWS Proton operations. It is frequently updated to align with `boto3` and `botocore` releases, often multiple times a month.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","mypy","type-hints","aws","proton","static-analysis"],"install":[{"cmd":"pip install boto3 mypy-boto3-proton","lang":"bash","label":"Install boto3 and mypy-boto3-proton"}],"dependencies":[{"reason":"Runtime dependency for AWS SDK functionality; mypy-boto3-proton provides only type stubs.","package":"boto3","optional":false}],"imports":[{"symbol":"ProtonClient","correct":"from mypy_boto3_proton.client import ProtonClient"},{"note":"Paginators are specific to list operations, e.g., ListComponentsPaginator.","symbol":"Paginator","correct":"from mypy_boto3_proton.paginator import ListComponentsPaginator"},{"note":"Type definitions are available in the `type_defs` module.","symbol":"TypeDefs","correct":"from mypy_boto3_proton.type_defs import CreateEnvironmentInputRequestTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_proton.client import ProtonClient\nfrom mypy_boto3_proton.type_defs import ListEnvironmentsOutputTypeDef\n\n# Ensure boto3 is installed: pip install boto3\n# Ensure stubs are installed: pip install mypy-boto3-proton\n\ndef get_proton_environments(client: ProtonClient) -> ListEnvironmentsOutputTypeDef:\n    \"\"\"Lists Proton environments using a type-hinted client.\"\"\"\n    response = client.list_environments()\n    return response\n\nif __name__ == \"__main__\":\n    # Initialize a boto3 client (region may vary)\n    # Use a region where Proton is available, e.g., 'us-west-2'\n    boto3_client = boto3.client(\"proton\", region_name=\"us-west-2\")\n\n    # Type-hint the boto3 client with mypy-boto3-proton's Client\n    proton_client: ProtonClient = boto3_client\n\n    print(\"Listing Proton environments:\")\n    try:\n        environments_data = get_proton_environments(proton_client)\n        for env in environments_data.get(\"environments\", []):\n            print(f\"  Environment: {env['name']} ({env['arn']}) - {env['provisioning']}\")\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n        print(\"Please ensure you have AWS credentials configured and Proton is available in 'us-west-2'.\")","lang":"python","description":"This quickstart demonstrates how to initialize a `boto3` client and apply `mypy-boto3-proton` type hints to enable static analysis for AWS Proton operations, then lists environments."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Support for Python 3.8 was removed with the underlying `mypy-boto3-builder` version 8.12.0. Projects using `mypy-boto3` stubs will now require Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0"},{"fix":"Verify `mypy` continues to correctly resolve imports. Ensure `mypy-boto3-proton` is installed in a standard location.","message":"The `mypy-boto3-builder` (version 8.12.0) migrated to the PEP 561 package format. While generally seamless, if you have custom `mypy` configurations or non-standard module resolution, this change *could* impact stub discovery.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0"},{"fix":"Review and update explicit `TypeDef` imports in your codebase according to the new naming conventions.","message":"In `mypy-boto3-builder` version 8.9.0, TypeDef names for packed method arguments were shortened (e.g., `CreateDistributionRequestRequestTypeDef` to `CreateDistributionRequestTypeDef`). If you explicitly import these TypeDefs, your code may break upon upgrading.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0"},{"fix":"Ensure `pip install boto3` is part of your project's dependencies.","message":"This package provides only type stubs for `boto3`. The actual `boto3` library must be installed and available at runtime for your code to function.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Regularly update `mypy-boto3-proton` alongside `boto3`. For example, if `boto3` is `1.x.y`, install `mypy-boto3-proton` `1.x.y`.","message":"For optimal type checking, it's crucial to align `mypy-boto3-proton`'s version with your `boto3` version. Mismatched versions can lead to incorrect type hints, missing attributes, or `mypy` errors if service APIs differ.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}