Install & Compatibility
Where this runs
tested against v1.43.48 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.610s · 51.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.0s · import 0.582s · 52MB
50MB installed
● package 50MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
MQClient
✓ from mypy_boto3_mq import MQClient
import boto3
client: MQClient = boto3.client("mq")
✗ from boto3.client import MQClient
The `MQClient` type definition comes from the `mypy-boto3-mq` stub package, not directly from `boto3` itself. While IDEs might implicitly suggest types, explicit import ensures strict type checking.
ListBrokersResponseTypeDef
✓ from mypy_boto3_mq.type_defs import ListBrokersResponseTypeDef
Type definitions for API responses and request parameters are found in `type_defs` submodules for explicit typing.
Demonstrates how to initialize an MQ client with type hints and call a basic operation like `list_brokers()`. Ensure `boto3` is installed and AWS credentials are configured in your environment.
import boto3
from mypy_boto3_mq import MQClient
from mypy_boto3_mq.type_defs import ListBrokersResponseTypeDef
import os
# Ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)
# For example, by setting AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION
# os.environ['AWS_REGION'] = os.environ.get('AWS_REGION', 'us-east-1')
def list_mq_brokers() -> None:
client: MQClient = boto3.client("mq")
try:
# Example: List Amazon MQ brokers
response: ListBrokersResponseTypeDef = client.list_brokers()
brokers = response.get('BrokerSummaries', [])
if brokers:
print("Amazon MQ Brokers found:")
for broker in brokers:
print(f" - Name: {broker.get('BrokerName')}, ARN: {broker.get('BrokerArn')}")
else:
print("No Amazon MQ brokers found.")
except client.exceptions.ClientError as e:
print(f"Error listing brokers: {e}")
if __name__ == "__main__":
list_mq_brokers()
Debug
Known issues
breakingStarting with `mypy-boto3-builder` version 8.12.0 (which generates `mypy-boto3-mq`), Python 3.8 is no longer supported. Projects requiring Python 3.8 should use older versions of `mypy-boto3-mq` or upgrade their Python interpreter.fixUpgrade Python to 3.9+ or pin `mypy-boto3-mq` to a version generated by `mypy-boto3-builder <8.12.0`.
affects: mypy-boto3-builder >=8.12.0
breakingThe `mypy-boto3-builder` (from version 8.12.0) migrated to PEP 561 compliant packaging. While generally beneficial, this change could potentially affect stub discovery in environments using older or non-standard build systems.fixEnsure your project setup and build tools are up-to-date and correctly configured to discover PEP 561 stubs.
affects: mypy-boto3-builder >=8.12.0
breakingWith `mypy-boto3-builder` version 8.9.0, type definition naming conventions were changed. Specifically, TypeDefs for packed method arguments use shorter names, and conflicting TypeDef `Extra` postfixes were moved to the end. If your code explicitly imported or referenced these generated TypeDefs by their full names, it will break.fixUpdate imports and references to TypeDefs to match the new naming conventions, or pin to an older `mypy-boto3-mq` version.
affects: mypy-boto3-builder >=8.9.0
gotchaPyCharm users might experience slow performance with Literal overloads in type hints. The `boto3-stubs-lite` package is recommended as a workaround until the upstream PyCharm issue (PY-40997) is resolved. This generally applies to all `mypy-boto3` generated stubs.fixConsider using `boto3-stubs-lite` if PyCharm performance is an issue, or disable specific linting rules in PyCharm.
affects: All versions
gotchaWhen using `TYPE_CHECKING` guards to avoid runtime dependencies, Pylint might report 'undefined variable' errors for the type-hinted objects.fixTo resolve Pylint complaints, set the type-hinted variables to `object` in the `else` block of your `TYPE_CHECKING` guard: `if TYPE_CHECKING: from mypy_boto3_mq import MQClient else: MQClient = object`.
affects: All versions
Upgrade
Version history
1.43.48latest on PyPI · released Jul 14, 2026
Audit
Dependencies
boto3requiredProvides the underlying AWS SDK for Python, which these stubs type-annotate.
mypyoptionalPrimary static type checker that utilizes these stub files.