{"id":3055,"library":"mypy-boto3-codepipeline","title":"mypy-boto3-codepipeline: Type Annotations for boto3 CodePipeline","description":"This library provides type annotations (stubs) for the `boto3` AWS CodePipeline client. It enables static type checking for `boto3` usage with tools like `mypy`, enhancing developer productivity and catching potential errors at compile time. Maintained by the `mypy-boto3-builder` project, it receives frequent updates to align with new `boto3` releases and `botocore` service definitions.","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","cloud","codepipeline"],"install":[{"cmd":"pip install mypy-boto3-codepipeline","lang":"bash","label":"Install package"},{"cmd":"pip install boto3 mypy","lang":"bash","label":"Install runtime and type checker"}],"dependencies":[{"reason":"Runtime dependency for which these type stubs are provided.","package":"boto3","optional":false},{"reason":"Primary type checker used with these stubs.","package":"mypy","optional":true}],"imports":[{"note":"Type stubs are separate packages and not part of the `boto3` runtime imports. Use `TYPE_CHECKING` to guard stub imports for runtime efficiency.","wrong":"from boto3.client import CodePipelineClient","symbol":"CodePipelineClient","correct":"from mypy_boto3_codepipeline.client import CodePipelineClient"},{"note":"Imports specific TypeDefs for precise type hinting of API responses.","symbol":"ListPipelinesOutputTypeDef","correct":"from mypy_boto3_codepipeline.type_defs import ListPipelinesOutputTypeDef"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING, List, Dict, Any\n\n# Guard type imports for runtime efficiency\nif TYPE_CHECKING:\n    from mypy_boto3_codepipeline.client import CodePipelineClient\n    from mypy_boto3_codepipeline.type_defs import ListPipelinesOutputTypeDef\n    \ndef get_codepipeline_pipelines() -> List[str]:\n    # The actual runtime client from boto3\n    client: CodePipelineClient = boto3.client(\"codepipeline\")\n\n    # The type checker knows the methods available on 'client'\n    response: ListPipelinesOutputTypeDef = client.list_pipelines()\n    \n    pipeline_names = [\n        p['name'] for p in response.get(\"pipelines\", [])\n        if 'name' in p and isinstance(p['name'], str)\n    ]\n    print(f\"CodePipeline Pipelines: {pipeline_names}\")\n    return pipeline_names\n\nif __name__ == \"__main__\":\n    # This example does not require specific credentials beyond default AWS configuration.\n    # Ensure boto3 is configured (e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, \n    # or ~/.aws/credentials, or IAM roles).\n    try:\n        pipelines = get_codepipeline_pipelines()\n    except Exception as e:\n        print(f\"Error fetching CodePipeline pipelines: {e}\")\n        print(\"Please ensure your AWS credentials and region are configured.\")\n","lang":"python","description":"This quickstart demonstrates how to use `mypy-boto3-codepipeline` to add static type checking to your `boto3` CodePipeline client interactions. The `TYPE_CHECKING` guard ensures that the stub imports are only processed by type checkers like `mypy` and are not loaded during runtime, improving application startup performance."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer. Ensure your `mypy` configuration is up-to-date and correctly identifies installed PEP 561 stubs.","message":"Python 3.8 support was removed and packages migrated to PEP 561.","severity":"breaking","affected_versions":"mypy-boto3-builder 8.12.0 and all generated stub packages (including mypy-boto3-codepipeline) released after this version."},{"fix":"You must install the `boto3` library (e.g., `pip install boto3`) separately for your code to run at runtime. `mypy-boto3-codepipeline` does not include the runtime library.","message":"This package provides *only* type annotations (stubs) for boto3.","severity":"gotcha","affected_versions":"All versions"},{"fix":"While `mypy-boto3` stubs generally work with a range of `boto3` versions, minor API discrepancies might exist between highly mismatched versions. Keep both `boto3` and `mypy-boto3-codepipeline` updated to their latest compatible versions for the best experience.","message":"For optimal type checking, align `mypy-boto3-codepipeline` with your `boto3` runtime version.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Wrap your `from mypy_boto3_codepipeline.client import ...` and `from mypy_boto3_codepipeline.type_defs import ...` imports within `if TYPE_CHECKING:` blocks. This ensures that the potentially large stub modules are only imported by type checkers and not during actual program execution, improving runtime performance.","message":"Use `if TYPE_CHECKING:` guards for stub imports to avoid runtime overhead.","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"}