Install & Compatibility
Where this runs
tested against v1.43.78 · 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 · 20MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.4s · import 0.000s · 20MB
18MB installed
● package 18MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
WAFV2Client
✓ from mypy_boto3_wafv2 import WAFV2Client
✗ from mypy_boto3_wafv2 import WAFV2Client
WAFV2ServiceResource
✓ from mypy_boto3_wafv2 import WAFV2ServiceResource
ServiceResource
✓ from mypy_boto3_wafv2 import ServiceResource
Demonstrates how to obtain a type-hinted WAFV2 client using boto3. The `TYPE_CHECKING` block is a common pattern to avoid runtime dependencies on the stub package while still getting type hints during static analysis.
import boto3
from typing import TYPE_CHECKING
from mypy_boto3_wafv2 import WAFV2Client
if TYPE_CHECKING:
# Only imported for type checking, not for runtime
pass
def get_wafv2_client() -> WAFV2Client:
# The boto3.client call is automatically typed by mypy-boto3
# if 'boto3-stubs' or 'mypy-boto3-wafv2' is installed.
client: WAFV2Client = boto3.client("wafv2")
return client
# Example usage (runtime functionality requires AWS credentials)
# client = get_wafv2_client()
# try:
# response = client.list_web_acls(Scope='CLOUDFRONT')
# print(response['WebACLs'])
# except Exception as e:
# print(f"Error listing Web ACLs: {e}")
Debug
Known issues
breakingPython 3.8 support has been removed since `mypy-boto3-builder` version 8.12.0. All `mypy-boto3-*` packages now require Python 3.9 or newer.fixUpgrade your Python environment to 3.9 or later.
affects: >=8.12.0 of mypy-boto3-builder, affecting all generated stubs
breakingThe `mypy-boto3` project migrated to PEP 561 for package structure with `mypy-boto3-builder` 8.12.0. This changes how stub packages are distributed and might affect custom tooling or build processes that relied on the previous package layout.fixEnsure your environment correctly handles PEP 561 compliant stub packages. Most standard Python tools (pip, setuptools) should handle this automatically.
affects: >=8.12.0 of mypy-boto3-builder, affecting all generated stubs
breakingType definition (TypedDict) naming conventions were changed in `mypy-boto3-builder` 8.9.0. This can break code that explicitly references old TypeDef names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`).fixUpdate your code to use the new, shorter TypeDef names. Refer to the specific service's documentation for correct names or rely on IDE autocompletion.
affects: >=8.9.0 of mypy-boto3-builder, affecting all generated stubs
gotchaWhen using `if TYPE_CHECKING:` guards to conditionally import type hints, Pylint might report undefined variables if the types are not explicitly assigned to `object` in the `else` branch. Mypy and other type checkers are generally fine without this.fixIn the `else` block of your `TYPE_CHECKING` guard, explicitly assign the imported types to `object`, e.g., `else: WAFV2Client = object`.
affects: All versions when using Pylint with `TYPE_CHECKING` guards
Upgrade
Version history
1.43.78latest on PyPI · released Aug 21, 2026
Audit
Dependencies
boto3requiredThis package provides type hints for boto3. Boto3 itself must be installed for the code to run.
mypyoptionalRequired for static type checking; pyright is also supported.