Install & Compatibility
Where this runs
tested against v1.43.71 · 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.664s · 116.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 6.0s · import 0.634s · 114MB
114MB installed
● package 114MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
CodeCommitClient
✓ from mypy_boto3_codecommit.client import CodeCommitClient
✗ from boto3.client import CodeCommitClient
Type stubs are provided by mypy_boto3_codecommit, not directly from boto3.
CodeCommitServiceResource
✓ from mypy_boto3_codecommit.service_resource import CodeCommitServiceResource
Use this for the service resource type, if needed.
This quickstart demonstrates how to initialize a type-hinted boto3 CodeCommit client and use one of its methods. Running `mypy app.py` against this script will leverage the installed type stubs to check for type correctness, enhancing development reliability.
import os
import boto3
from mypy_boto3_codecommit.client import CodeCommitClient
from botocore.exceptions import ClientError
# Ensure AWS_REGION is set in environment variables or provide region_name directly
region = os.environ.get("AWS_REGION", "us-east-1")
try:
# Initialize a typed CodeCommit client
client: CodeCommitClient = boto3.client("codecommit", region_name=region)
print(f"Listing repositories in region: {region}...")
# Use a client method with type hints
response = client.list_repositories(
sortBy="repositoryName",
order="ascending"
)
repositories = response.get("repositories", [])
if repositories:
print(f"Found {len(repositories)} repositories:")
for repo in repositories[:3]: # Limit output for brevity
print(f"- {repo['repositoryName']} (ID: {repo['repositoryId']})")
else:
print("No repositories found.")
except ClientError as e:
print(f"AWS Client Error: {e}")
except Exception as e:
print(f"An unexpected error occurred: {e}")
# To verify types, save this code as `app.py` and run:
# mypy app.py
Debug
Known issues
breakingPython 3.8 support was removed for all mypy-boto3 packages from builder version 8.12.0 onwards. If you are using an older Python version, you must pin your mypy-boto3-* packages to an earlier version.fixUpgrade to Python 3.9+ or pin `mypy-boto3-codecommit` to a version compatible with Python 3.8 (e.g., `<1.42.0`).
affects: mypy-boto3-builder >= 8.12.0 (affecting mypy-boto3-codecommit ~1.42.0+)
breakingTypeDef names for method arguments and conflicting names were refactored (e.g., `CreateDistributionRequestRequestTypeDef` to `CreateDistributionRequestTypeDef`, `CreateDistributionExtraRequestTypeDef` to `CreateDistributionRequestExtraTypeDef`). If you directly imported these `TypeDef`s, your code will break.fixUpdate your import paths and references to the new `TypeDef` names. Consult the `mypy-boto3` documentation or regenerate your local stubs to find the correct names.
affects: mypy-boto3-builder >= 8.9.0 (affecting mypy-boto3-codecommit ~1.39.0+)
gotchamypy-boto3-codecommit provides *only* type stubs. You must also install `boto3` (and `mypy`) for your code to run and for type checking to be effective. Installing only the stubs will result in runtime `ModuleNotFoundError` for `boto3`.fixEnsure both `boto3` and `mypy-boto3-codecommit` are installed in your environment: `pip install boto3 mypy-boto3-codecommit mypy`.
affects: All versions
gotchaType stubs are generated for specific boto3 versions. Mismatched `boto3` and `mypy-boto3-codecommit` versions can lead to incorrect type checking results (false positives/negatives) if AWS API definitions have changed significantly between versions.fixIdeally, keep `boto3` and `mypy-boto3-codecommit` versions synchronized. Check the `mypy-boto3` builder's releases for which `boto3` version a stub package corresponds to, or use a tool like `pip-tools` to manage dependencies consistently.
affects: All versions
gotchaForgetting to run `mypy` against your code means you won't benefit from the type checking provided by `mypy-boto3-codecommit`. The stubs do not enforce types at runtime.fixIntegrate `mypy` into your development workflow and CI/CD pipeline (e.g., `mypy your_script.py` or `mypy .` for a project).
affects: All versions
Upgrade
Version history
1.43.71latest on PyPI · released Aug 13, 2026
Audit
Dependencies
boto3requiredRuntime dependency for AWS SDK functionality, without which the stubs are useless.
mypyrequiredDevelopment dependency for static type checking, the primary purpose of this library.