{"id":3052,"library":"mypy-boto3-codedeploy","title":"Type annotations for boto3 CodeDeploy","description":"mypy-boto3-codedeploy provides comprehensive type annotations for the boto3 CodeDeploy service, enhancing development with static type checking, auto-completion, and improved error detection. This package is currently at version 1.42.3 and is actively maintained with frequent updates to align with boto3 releases and the underlying mypy-boto3-builder (version 8.12.0).","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["AWS","boto3","mypy","type-hints","codedeploy","typing"],"install":[{"cmd":"pip install mypy-boto3-codedeploy","lang":"bash","label":"Standalone package"},{"cmd":"pip install 'boto3-stubs[codedeploy]' # Requires boto3-stubs>=8.9.0","lang":"bash","label":"Via boto3-stubs with extras"}],"dependencies":[{"reason":"Provides the AWS SDK functionality that these type stubs annotate.","package":"boto3"},{"reason":"Required for static type checking using these annotations.","package":"mypy","optional":true},{"reason":"May be required for full feature support on Python versions < 3.10, particularly for `NotRequired` and `TypeAlias`.","package":"typing-extensions","optional":true}],"imports":[{"note":"Legacy import path from older mypy-boto3 versions (pre-8.9.0). Current standalone packages use service-specific top-level modules like `mypy_boto3_codedeploy`.","wrong":"from mypy_boto3.codedeploy import CodeDeployClient","symbol":"CodeDeployClient","correct":"from mypy_boto3_codedeploy.client import CodeDeployClient"},{"note":"Type definitions are typically found in the `type_defs` submodule.","symbol":"DeploymentInfoTypeDef","correct":"from mypy_boto3_codedeploy.type_defs import DeploymentInfoTypeDef"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\nfrom os import environ\n\nif TYPE_CHECKING:\n    from mypy_boto3_codedeploy.client import CodeDeployClient\n    from mypy_boto3_codedeploy.type_defs import ListApplicationsOutputTypeDef\n\ndef get_codedeploy_client() -> CodeDeployClient:\n    \"\"\"Returns a type-hinted CodeDeploy client.\"\"\"\n    session = boto3.session.Session(\n        aws_access_key_id=environ.get('AWS_ACCESS_KEY_ID', ''),\n        aws_secret_access_key=environ.get('AWS_SECRET_ACCESS_KEY', ''),\n        aws_session_token=environ.get('AWS_SESSION_TOKEN', ''),\n        region_name=environ.get('AWS_REGION', 'us-east-1')\n    )\n    return session.client(\"codedeploy\")\n\ndef list_codedeploy_applications():\n    client: CodeDeployClient = get_codedeploy_client()\n    response: ListApplicationsOutputTypeDef = client.list_applications()\n    print(\"CodeDeploy Applications:\")\n    for app_name in response.get(\"applications\", []):\n        print(f\"- {app_name}\")\n\nif __name__ == \"__main__\":\n    list_codedeploy_applications()","lang":"python","description":"This quickstart demonstrates how to get a type-hinted CodeDeploy client and use it to list applications. It includes explicit type annotations for `CodeDeployClient` and a response `TypeDef` to leverage the type stubs effectively."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher. The `requires_python` metadata is `^3.9`.","message":"Python 3.8 support was removed starting with `mypy-boto3-builder` version 8.12.0 and affects all generated `mypy-boto3-*` packages, including `mypy-boto3-codedeploy`.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0, mypy-boto3-codedeploy >= 1.42.0"},{"fix":"Review and update `TypeDef` import paths and usage in your codebase to reflect the new naming conventions. Consult the specific service's `type_defs.pyi` for accurate names.","message":"In `mypy-boto3-builder` version 8.9.0, there were breaking changes to TypeDef naming conventions. Specifically, `TypeDefs` for packed method arguments use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` became `CreateDistributionRequestExtraTypeDef`).","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0, mypy-boto3-codedeploy >= 1.39.0"},{"fix":"Migrate from `mypy-boto3` to either standalone `mypy-boto3-codedeploy` or `boto3-stubs[codedeploy]` for better modularity and future compatibility.","message":"The standalone `mypy-boto3` package (e.g., `pip install mypy-boto3`) is considered legacy. Users are encouraged to install service-specific packages like `mypy-boto3-codedeploy` directly, or use the `boto3-stubs` package with service-specific extras (`pip install 'boto3-stubs[codedeploy]'`).","severity":"deprecated","affected_versions":"mypy-boto3-builder >= 8.9.0"},{"fix":"If experiencing performance issues in PyCharm, consider using `boto3-stubs-lite` (e.g., `pip install 'boto3-stubs-lite[codedeploy]'`) which requires explicit type annotations but can be more RAM-friendly until the PyCharm issue is resolved.","message":"When using PyCharm, performance issues with `Literal` overloads have been reported (PY-40997). This can lead to slow IDE performance when using full `boto3-stubs` packages.","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"}