{"id":3668,"library":"mypy-boto3-pcs","title":"mypy-boto3-pcs Type Stubs","description":"mypy-boto3-pcs provides type annotations for the `boto3` ParallelComputingService, enhancing code completion and static analysis with tools like MyPy. It is part of the `mypy-boto3` project, which auto-generates type stubs for all `boto3` services and is actively maintained with frequent updates mirroring `boto3` releases.","status":"active","version":"1.42.75","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","stubs","cloud","static-analysis","python"],"install":[{"cmd":"pip install mypy-boto3-pcs boto3","lang":"bash","label":"Install with boto3"}],"dependencies":[{"reason":"Provides the AWS SDK functionality for which these are type stubs.","package":"boto3","optional":false},{"reason":"Minimum required Python version for all mypy-boto3 packages.","package":"python","optional":false}],"imports":[{"note":"Import the client type for the ParallelComputingService for type hinting boto3 clients.","symbol":"ParallelComputingServiceClient","correct":"from mypy_boto3_pcs.client import ParallelComputingServiceClient"},{"note":"Type hint the boto3 client creation. Direct import of the client type is for annotation, not runtime instantiation.","symbol":"ParallelComputingServiceClient","correct":"import boto3\nfrom mypy_boto3_pcs.client import ParallelComputingServiceClient\n\ndef get_pcs_client() -> ParallelComputingServiceClient:\n    return boto3.client('pcs')"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_pcs.client import ParallelComputingServiceClient\nfrom os import environ\n\n# Ensure boto3 is installed: pip install boto3 mypy-boto3-pcs\n\ndef get_pcs_client() -> ParallelComputingServiceClient:\n    \"\"\"Returns a type-hinted ParallelComputingService client.\"\"\"\n    # Boto3 client creation with type hint\n    client: ParallelComputingServiceClient = boto3.client(\n        'pcs',\n        region_name=environ.get('AWS_REGION', 'us-east-1'),\n        aws_access_key_id=environ.get('AWS_ACCESS_KEY_ID', ''),\n        aws_secret_access_key=environ.get('AWS_SECRET_ACCESS_KEY', '')\n    )\n    return client\n\nif __name__ == '__main__':\n    pcs_client = get_pcs_client()\n    # Now `pcs_client` has type hints for ParallelComputingService methods\n    print(f\"Client type: {type(pcs_client)}\")\n    # Example of a method call (replace with actual PCS method if needed)\n    # This specific service 'pcs' is less common for simple public examples.\n    # print(pcs_client.list_resources())\n","lang":"python","description":"This quickstart demonstrates how to obtain a type-hinted `boto3` client for the ParallelComputingService using `mypy-boto3-pcs`. It emphasizes the need to install both `boto3` and the type stubs, and how to correctly annotate the client for static analysis."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Support for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0. All generated `mypy-boto3` packages, including `mypy-boto3-pcs`, now require Python 3.9 or higher.","severity":"breaking","affected_versions":">=8.12.0 of mypy-boto3-builder (which generates mypy-boto3-pcs 1.42.x and higher)"},{"fix":"Update your type annotations to use the new, shorter TypeDef names. Refer to the specific service documentation for the correct TypeDef names.","message":"In `mypy-boto3-builder` version 8.9.0, TypeDef names for packed method arguments were shortened (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). This can cause type-checking errors if you were explicitly referencing the older, longer TypeDef names.","severity":"breaking","affected_versions":">=8.9.0 of mypy-boto3-builder"},{"fix":"Ensure `boto3` is installed in your environment: `pip install boto3`.","message":"`mypy-boto3-pcs` only provides type stubs, not the `boto3` library itself. You *must* install `boto3` separately for your code to function at runtime. The type stubs are solely for static analysis.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider `pip install 'boto3-stubs[pcs]'` instead of or in addition to `mypy-boto3-pcs` for better integration, especially if using multiple `boto3` services.","message":"While direct installation like `pip install mypy-boto3-pcs` works, for comprehensive `boto3` type-hinting across multiple services, the `boto3-stubs` package with extras (e.g., `pip install 'boto3-stubs[full]'` or `pip install 'boto3-stubs[pcs]'`) is often recommended as the primary entry point for type annotations. This ensures consistency and proper integration for all services you use.","severity":"gotcha","affected_versions":"all"},{"fix":"Always check the official `mypy-boto3` documentation or AWS service documentation for the latest service names and recommended alternatives if you encounter `ModuleNotFoundError` for a service stub.","message":"Some AWS service names or their corresponding `mypy-boto3` stub packages may be deprecated or renamed over time, reflecting changes in the AWS SDK. For example, the `sms-voice` service was removed in `mypy-boto3-builder` 8.11.0, with `pinpoint-sms-voice` as its replacement.","severity":"deprecated","affected_versions":">=8.11.0 of mypy-boto3-builder"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}