Registry /
type-stubs / mypy-boto3-codeguru-reviewer
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.95 runs
installs and imports cleanly · install 0.0s · import 0.632s · 116.5MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 6.0s · import 0.568s · 114MB
114MB installed
● package 114MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
CodeGuruReviewerClient
✓ from mypy_boto3_codeguru_reviewer.client import CodeGuruReviewerClient
Use this for type-hinting the boto3 CodeGuru Reviewer client instance.
ListRepositoryAssociationsResponseTypeDef
✓ from mypy_boto3_codeguru_reviewer.type_defs import ListRepositoryAssociationsResponseTypeDef
Import specific TypeDefs for precise type-hinting of API call responses. Other TypeDefs are available for various service operations.
CodeGuruReviewerServiceName
✓ from mypy_boto3_codeguru_reviewer.literals import CodeGuruReviewerServiceName
Useful when using overloads for boto3.client directly, though explicit client imports are often preferred.
This quickstart demonstrates how to initialize a type-hinted CodeGuruReviewer client and call a basic operation, `list_repository_associations`, with its response also fully type-hinted. Ensure `boto3` and `mypy` are installed alongside this stub package. For actual execution, valid AWS credentials and region must be configured.
import boto3
from mypy_boto3_codeguru_reviewer.client import CodeGuruReviewerClient
from mypy_boto3_codeguru_reviewer.type_defs import ListRepositoryAssociationsResponseTypeDef
import os
def get_reviewer_client() -> CodeGuruReviewerClient:
"""Returns a type-hinted CodeGuruReviewer client."""
# Ensure AWS_REGION is set in environment or configure it explicitly
return boto3.client("codeguru-reviewer", region_name=os.environ.get("AWS_REGION", "us-east-1"))
def list_reviewer_associations() -> ListRepositoryAssociationsResponseTypeDef:
"""Lists CodeGuru Reviewer repository associations with type hints."""
client: CodeGuruReviewerClient = get_reviewer_client()
response: ListRepositoryAssociationsResponseTypeDef = client.list_repository_associations()
print("CodeGuru Reviewer Repository Associations:")
for association in response.get("RepositoryAssociationSummaries", []):
print(f"- {association.get('Name')} (State: {association.get('State')})")
return response
if __name__ == "__main__":
# Set dummy environment variables if not already set, for demonstration purposes.
# In a real scenario, use proper AWS credential configuration.
if not os.environ.get("AWS_ACCESS_KEY_ID"):
os.environ["AWS_ACCESS_KEY_ID"] = "TEST_KEY"
if not os.environ.get("AWS_SECRET_ACCESS_KEY"):
os.environ["AWS_SECRET_ACCESS_KEY"] = "TEST_SECRET"
if not os.environ.get("AWS_REGION"):
os.environ["AWS_REGION"] = "us-east-1"
try:
list_reviewer_associations()
except Exception as e:
# Boto3 client operations will fail if credentials are not valid,
# but mypy type checking will still work.
print(f"An error occurred during runtime: {e}")
print("Please ensure your AWS credentials and region are configured correctly for actual execution.")
Debug
Known issues
breakingPython 3.8 support was removed starting with `mypy-boto3-builder` version 8.12.0. `mypy-boto3-codeguru-reviewer` versions aligning with this builder version (1.42.3 and newer) will only support Python 3.9 and higher. Users on Python 3.8 must upgrade their Python environment.fixUpgrade your Python environment to 3.9 or newer.
affects: mypy-boto3-builder >=8.12.0 (equivalent mypy-boto3-codeguru-reviewer versions >=1.42.3)
breakingTypeDef naming conventions changed in `mypy-boto3-builder` version 8.9.0. This can lead to shorter names for method argument TypeDefs (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`) and postfix changes for conflicting names. Existing type hints in your code that reference older TypeDef names may break.fixUpdate your TypeDef import paths and names to align with the new conventions by checking the generated `type_defs.pyi` for the service or the `mypy-boto3` documentation.
affects: mypy-boto3-builder >=8.9.0
gotchaThis library is a PEP 561-compliant stub-only package. It provides type information for `boto3`, but `boto3` itself must still be installed separately for the code to run. For `mypy` to properly find and utilize these type stubs, `mypy-boto3-codeguru-reviewer` (or the overarching `boto3-stubs` package) must be installed in the Python environment where `mypy` is executed.fixEnsure both `boto3` and `mypy-boto3-codeguru-reviewer` are installed in your project's environment. Run `mypy` from an environment where these packages are accessible.
affects: All versions
gotchaWhile `mypy-boto3-stubs` (the umbrella package) can offer some auto-discovery for `boto3.client` calls, for the most robust type checking, consistent autocomplete in IDEs, and clear code, it is generally recommended to explicitly type-hint your `boto3` client objects using imports like `from mypy_boto3_codeguru_reviewer.client import CodeGuruReviewerClient`.fixAlways add explicit type annotations for `boto3` clients and resources, such as `client: CodeGuruReviewerClient = boto3.client("codeguru-reviewer")`. affects: All versions
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredProvides the AWS SDK functionality that this library adds type hints for.
mypyrequiredStatic type checker that utilizes these annotations.