{"id":3378,"library":"mypy-boto3-supplychain","title":"mypy-boto3-supplychain","description":"mypy-boto3-supplychain provides type annotations for the `boto3` AWS SupplyChain service, enhancing static type checking with tools like MyPy, Pyright, and improving IDE auto-completion. It is generated by `mypy-boto3-builder` and is currently at version 1.42.3, following the boto3 release cycle. The project maintains an active release cadence, frequently updating stubs to match new AWS service versions and features.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","mypy","type-hinting","aws","stubs","supplychain"],"install":[{"cmd":"pip install mypy-boto3-supplychain boto3","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"This package provides type stubs for the 'boto3' library, which is a runtime dependency.","package":"boto3"},{"reason":"Requires Python 3.9 or newer.","package":"python","optional":false}],"imports":[{"note":"While `boto3.client('supplychain')` works at runtime, type checkers need the explicit `SupplyChainClient` import for full static analysis and auto-completion.","wrong":"import boto3; client = boto3.client('supplychain')","symbol":"SupplyChainClient","correct":"from mypy_boto3_supplychain.client import SupplyChainClient"},{"note":"Type definitions (TypedDicts) for API response objects are found in `type_defs`.","symbol":"ListDataIntegrationFlowsOutputTypeDef","correct":"from mypy_boto3_supplychain.type_defs import ListDataIntegrationFlowsOutputTypeDef"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from mypy_boto3_supplychain.client import SupplyChainClient\n    from mypy_boto3_supplychain.type_defs import ListDataIntegrationFlowsOutputTypeDef\n\n\ndef get_supply_chain_flows() -> ListDataIntegrationFlowsOutputTypeDef:\n    # boto3 client creation is untyped at runtime, hence the type hint below\n    client: SupplyChainClient = boto3.client(\"supplychain\")\n    response = client.list_data_integration_flows()\n    print(f\"Found {len(response.get('dataIntegrationFlows', []))} data integration flows.\")\n    return response\n\nif __name__ == \"__main__\":\n    # Ensure AWS credentials are configured (e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY env vars)\n    # or AWS CLI configuration.\n    try:\n        flows = get_supply_chain_flows()\n        # Accessing typed properties\n        for flow in flows.get('dataIntegrationFlows', []):\n            print(f\"  Flow ID: {flow['dataIntegrationFlowId']}, Status: {flow['status']}\")\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n        print(\"Please ensure 'boto3' is installed and AWS credentials are configured.\")\n","lang":"python","description":"This example demonstrates how to use `mypy-boto3-supplychain` for type-hinting a boto3 SupplyChain client and its response. The `TYPE_CHECKING` guard ensures that `mypy-boto3` is only a development dependency. It retrieves and prints data integration flows."},"warnings":[{"fix":"Upgrade your project's Python version to 3.9 or newer. Ensure your `requires_python` is set appropriately.","message":"Support for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0 and subsequent `mypy-boto3-*` packages. Projects targeting Python 3.8 will no longer receive updates or new type stubs.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Review your `type_defs` imports and usage to align with the new naming conventions. Static type checkers will highlight affected areas.","message":"Starting with `mypy-boto3-builder` 8.9.0, there were breaking changes to `TypeDef` naming conventions. Specifically, packed method arguments may use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and conflicting `TypeDef` 'Extra' postfixes were moved to the end.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0"},{"fix":"Apply explicit type hints as shown in the quickstart (e.g., `client: SupplyChainClient = boto3.client(...)`). For PyCharm performance, consider `boto3-stubs-lite` or relying on external type checking.","message":"For optimal static analysis and IDE auto-completion (especially in VSCode), explicit type annotations for `boto3.client` and `boto3.resource` calls are often recommended, even though `mypy-boto3` attempts auto-discovery. PyCharm users might experience slow performance with `Literal` overloads, in which case `boto3-stubs-lite` or external type checkers like MyPy/Pyright are suggested.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Enclose type stub imports like `from mypy_boto3_supplychain.client import SupplyChainClient` within `if TYPE_CHECKING:` conditional blocks.","message":"To prevent `mypy-boto3-*` packages from becoming runtime dependencies, it is best practice to wrap all imports of types from these libraries within a `if typing.TYPE_CHECKING:` block. This ensures they are only used during static analysis.","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"}