Install & Compatibility
Where this runs
tested against v1.43.0 · 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.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.3MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.7s · import 0.000s · 19MB
71MB installed
● package 71MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
QAppsClient
✓ from mypy_boto3_qapps.client import QAppsClient
✗ from mypy_boto3_qapps import QAppsClient
QAppsServiceClient
✓ from mypy_boto3_qapps import QAppsServiceClient
Client
✓ from mypy_boto3_qapps.client import Client
Demonstrates how to initialize a `boto3` QApps client with type annotations and use a type-checked `CreateQAppRequestRequestTypeDef` for creating a QApp. The `TYPE_CHECKING` block ensures that stub imports are only active during static analysis, preventing runtime errors if stubs are a dev dependency. Remember to replace placeholder `instanceId` and `appDefinitionArn` with actual values.
import boto3
from typing import TYPE_CHECKING, Dict, Any
from mypy_boto3_qapps.client import QAppsClient
from mypy_boto3_qapps.type_defs import CreateQAppRequestRequestTypeDef, CreateQAppResponseTypeDef
# Instantiate the boto3 client, annotated with mypy-boto3 types
# Use TYPE_CHECKING block to avoid runtime dependency if stubs are dev-only
if TYPE_CHECKING:
client: QAppsClient = boto3.client("qapps")
else:
client = boto3.client("qapps")
# Example: Create a QApp
# Note: This is a dummy example; replace placeholder values with actual data.
# The instanceId typically refers to an Amazon Q instance.
instance_id = "your_amazon_q_instance_id" # e.g., 'your-instance-id'
create_qapp_params: CreateQAppRequestRequestTypeDef = {
"instanceId": instance_id,
"appDefinition": {
"appDefinitionArn": "arn:aws:qapps:region:account:app/id", # Example ARN
"appDefinitionType": "PACKAGE_JSON"
}
# "tags": {"key": "value"} # Optional
}
try:
print(f"Attempting to create QApp for instance: {instance_id}")
response: CreateQAppResponseTypeDef = client.create_q_app(
**create_qapp_params
)
print(f"Successfully created QApp.")
print(f"App ID: {response.get('appId')}")
print(f"App ARN: {response.get('appArn')}")
print(f"Status: {response.get('status')}")
except client.exceptions.ValidationException as e:
print(f"Validation Error: {e}")
except client.exceptions.ResourceNotFoundException as e:
print(f"Resource Not Found Error: {e}")
except Exception as e:
print(f"An unexpected error occurred: {e}")
Debug
Known issues
breakingStarting with `mypy-boto3-builder` version 8.12.0, Python 3.8 is no longer supported for generated type stubs. Projects targeting `mypy-boto3-qapps` (and other `mypy-boto3-*` packages) must use Python 3.9 or newer.fixUpgrade your Python environment to 3.9 or later. If unable to upgrade, pin `mypy-boto3-qapps` to a version compatible with builder < 8.12.0 (e.g., `<1.42.0`).
affects: mypy-boto3-builder >= 8.12.0 (affecting mypy-boto3-qapps >= 1.42.0)
breakingTypeDef naming conventions were changed in `mypy-boto3-builder` 8.9.0. Some TypeDef names, especially those ending with `RequestRequestTypeDef` or `ExtraRequestTypeDef`, have been shortened or reordered (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). This impacts direct imports of TypeDef classes.fixReview your `from mypy_boto3_qapps.type_defs import ...` statements and adjust TypeDef names according to the new conventions. Consult the `mypy-boto3` documentation for the specific service if needed.
affects: mypy-boto3-builder >= 8.9.0 (affecting mypy-boto3-qapps >= 1.35.0)
gotchaThe `mypy-boto3-*` packages are service-specific type stubs. You must install the specific package for each AWS service you use (e.g., `mypy-boto3-qapps` for QApps). Installing `mypy-boto3` (the meta-package) includes stubs for all services and can lead to a large installation footprint and potential conflicts.fixAlways install `mypy-boto3-servicename` for the specific services you need, rather than the monolithic `mypy-boto3` package, to optimize install size and avoid unnecessary dependencies.
affects: All versions
gotchaWhen annotating a `boto3` client with `mypy-boto3` types, it's best practice to wrap the type annotation in a `if TYPE_CHECKING:` block. This prevents runtime `ImportError` if `mypy-boto3-*` stubs are installed as development dependencies and not available in the production environment.fixUse `from typing import TYPE_CHECKING` and enclose your type hints like `if TYPE_CHECKING: client: QAppsClient = boto3.client('qapps')`. affects: All versions
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredRuntime dependency for the AWS SDK, mypy-boto3-qapps provides type stubs for it.