Registry /
type-stubs / mypy-boto3-migration-hub-refactor-spaces
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.638s · 116.6MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 5.9s · import 0.580s · 114MB
114MB installed
● package 114MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
MigrationHubRefactorSpacesClient
✓ from mypy_boto3_migration_hub_refactor_spaces.client import MigrationHubRefactorSpacesClient
✗ client = boto3.client('migration-hub-refactor-spaces')
Importing the specific client class from the stub package enables full type checking and IDE autocompletion.
ListEnvironmentsOutputTypeDef
✓ from mypy_boto3_migration_hub_refactor_spaces.type_defs import ListEnvironmentsOutputTypeDef
TypeDefs provide precise type hints for API response structures.
EnvironmentStatusType
✓ from mypy_boto3_migration_hub_refactor_spaces.literals import EnvironmentStatusType
Literals provide type-checked string constants for specific API parameters.
Demonstrates how to obtain a type-annotated `boto3` client for Migration Hub Refactor Spaces and perform a basic API call with type-checked inputs and outputs. Ensure `boto3` is installed alongside this stub package.
import boto3
from mypy_boto3_migration_hub_refactor_spaces.client import MigrationHubRefactorSpacesClient
from mypy_boto3_migration_hub_refactor_spaces.type_defs import ListEnvironmentsOutputTypeDef
from mypy_boto3_migration_hub_refactor_spaces.literals import EnvironmentStatusType
def get_typed_client() -> MigrationHubRefactorSpacesClient:
"""Returns a type-annotated Migration Hub Refactor Spaces client."""
# boto3 is the actual runtime library, mypy-boto3-migration-hub-refactor-spaces provides type hints
client: MigrationHubRefactorSpacesClient = boto3.client("migration-hub-refactor-spaces")
return client
if __name__ == "__main__":
refactor_client = get_typed_client()
try:
# Example: List environments with type-checked response
environments: ListEnvironmentsOutputTypeDef = refactor_client.list_environments(
# Add optional filters for type-checking
MaxResults=100
)
print(f"Found {len(environments.get('EnvironmentSummaryList', []))} environments.")
# Example of using a literal for a parameter
# This is a placeholder as list_environments doesn't have a status filter directly
# if environments.get('EnvironmentSummaryList'):
# first_env = environments['EnvironmentSummaryList'][0]
# if first_env.get('Status') == EnvironmentStatusType.ACTIVE:
# print(f"First environment '{first_env.get('Name')}' is active.")
except refactor_client.exceptions.ResourceNotFoundException:
print("No Refactor Spaces environments found.")
except Exception as e:
print(f"An unexpected error occurred: {e}")
Debug
Known issues
breakingSupport for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 or older will need to upgrade their Python version.fixUpgrade Python to version 3.9 or newer.
affects: mypy-boto3-builder >=8.12.0 (affects all generated stubs)
breakingThe `mypy-boto3-builder` (version 8.12.0) migrated to PEP 561 compliant packages. While this is largely an internal change, it ensures better compatibility and discovery by type checkers. Older, non-compliant configurations might require updates.fixEnsure your `mypy` configuration is up-to-date and that stub packages are installed in the same environment as `mypy`.
affects: mypy-boto3-builder >=8.12.0 (affects all generated stubs)
gotchaThis package provides *only* type annotations. You must install `boto3` separately (e.g., `pip install boto3`) for your code to run at runtime. Without `boto3`, type checking will work, but runtime execution will fail.fixAlways install `boto3` alongside `mypy-boto3-migration-hub-refactor-spaces`.
affects: All versions
breakingTypeDef naming conventions changed in `mypy-boto3-builder` version 8.9.0. TypeDefs for packed arguments use shorter names, and conflicting `Extra` postfixes were moved. If you directly import specific TypeDefs, their names might have changed.fixConsult the official documentation for the updated TypeDef names and adjust your import statements accordingly.
affects: mypy-boto3-builder >=8.9.0 (affects all generated stubs)
gotchaWhile `mypy-boto3` stubs enable auto-discovery for `boto3.client()` calls, explicit type annotations for the client variable (e.g., `client: MigrationHubRefactorSpacesClient = boto3.client(...)`) are highly recommended for optimal IDE autocompletion and more robust type checking, especially in VSCode and PyCharm.fixAdd explicit type hints to your `boto3` client and resource variables.
affects: All versions
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredProvides the AWS SDK runtime functionality that these stubs type-check.
mypyoptionalThe primary static type checker for which these stubs are designed.