{"id":3641,"library":"mypy-boto3-mpa","title":"mypy-boto3-mpa: Type Annotations for boto3 Multiparty Approval Service","description":"mypy-boto3-mpa provides precise type annotations for the boto3 Multiparty Approval (MPA) service, generated by the `mypy-boto3-builder`. It helps improve code quality and catch type-related errors at development time when working with the AWS MPA API using boto3. The current version is 1.42.62, and releases are frequent, typically in sync with new boto3/botocore releases and AWS service updates.","status":"active","version":"1.42.62","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","aws","mypy","type-hints","stubs","cloud","mpa"],"install":[{"cmd":"pip install mypy-boto3-mpa boto3 mypy","lang":"bash","label":"Install with core dependencies"}],"dependencies":[{"reason":"Runtime library for interacting with AWS services. These stubs provide type hints for boto3.","package":"boto3","optional":false},{"reason":"The primary static type checker that utilizes these stubs.","package":"mypy","optional":true}],"imports":[{"note":"Client types are typically located within the `.client` submodule of the stub package.","wrong":"from mypy_boto3_mpa import MPAClient","symbol":"MPAClient","correct":"from mypy_boto3_mpa.client import MPAClient"},{"note":"Specific TypeDef classes are found in the `.type_defs` submodule.","symbol":"MPATypeDef","correct":"from mypy_boto3_mpa.type_defs import ApprovalRuleSummaryTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_mpa.client import MPAClient\nfrom mypy_boto3_mpa.type_defs import ListApprovalRulesOutputTypeDef\n\ndef get_mpa_rules() -> ListApprovalRulesOutputTypeDef:\n    # mypy-boto3-mpa provides type hints for the boto3 client\n    client: MPAClient = boto3.client(\"mpa\")\n    # Replace with an actual operation that returns a list of rules\n    # For a real scenario, you'd call a valid MPA API operation.\n    response: ListApprovalRulesOutputTypeDef = client.list_approval_rules() # type: ignore\n    print(f\"Found {len(response.get('ApprovalRules', []))} approval rules.\")\n    return response\n\nif __name__ == '__main__':\n    # This example requires boto3 and mypy-boto3-mpa to be installed.\n    # The 'type: ignore' comment is used because 'list_approval_rules' \n    # is a placeholder and might not exist or require specific parameters.\n    # In a real application, you would use actual MPA service methods.\n    try:\n        get_mpa_rules()\n    except Exception as e:\n        print(f\"Could not fetch MPA rules (this is expected if the service method is a placeholder or not configured): {e}\")","lang":"python","description":"This example demonstrates how to obtain a type-hinted MPA client using `boto3.client` and import a specific TypeDef. `mypy` will then use the installed `mypy-boto3-mpa` stubs to provide static type checking for your boto3 calls. Note that `list_approval_rules` is a placeholder operation, and you'd replace it with an actual MPA API call in a functional application."},"warnings":[{"fix":"Upgrade your Python environment to version 3.9 or higher.","message":"Support for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0 and later, which affects all generated stub packages including `mypy-boto3-mpa`. Ensure your project uses Python 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0 (builder), >=1.42.0 (stubs)"},{"fix":"Ensure your `mypy` version is up-to-date and your build system correctly recognizes PEP 561 packages. No direct code changes are typically required unless you were manipulating stub paths directly.","message":"The `mypy-boto3` ecosystem migrated to PEP 561 compliant packages in version 8.12.0. While this improves discoverability for `mypy`, it might require updates to build systems or older `mypy` versions that relied on previous stub package structures. This also means packages are now `py.typed`.","severity":"breaking","affected_versions":">=8.12.0 (builder), >=1.42.0 (stubs)"},{"fix":"Review and update any custom TypeDef imports or direct references to TypeDef names if they were affected by these naming conventions. Use auto-completion in your IDE to find the correct new names.","message":"In builder version 8.9.0, there were breaking changes to how TypeDefs for packed method arguments and conflicting names were generated. TypeDefs now use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`) and conflicting `Extra` postfixes are moved to the end.","severity":"breaking","affected_versions":">=8.9.0 (builder), >=1.39.0 (stubs)"},{"fix":"Always import `boto3` for runtime interactions. `mypy-boto3-mpa` should only be installed in your development environment for type checking purposes.","message":"`mypy-boto3-mpa` is a type stub package; it does not provide runtime functionality. It should not be imported as a regular library to instantiate clients or resources. Its purpose is solely for static type checking with tools like `mypy`.","severity":"gotcha","affected_versions":"All"},{"fix":"Regularly update `mypy-boto3-mpa` along with your `boto3` library. The `mypy-boto3-builder` typically generates stubs based on the latest botocore/boto3 versions.","message":"For optimal type checking, ensure that the version of `mypy-boto3-mpa` (and other `mypy-boto3-*` stubs) generally aligns with the version of `boto3` you are using. While minor mismatches often work, significant version differences can lead to incorrect type hints or missing definitions.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}