{"id":3091,"library":"mypy-boto3-fsx","title":"mypy-boto3-fsx type annotations","description":"mypy-boto3-fsx provides PEP 561 compliant type annotations for the AWS FSx service client in boto3. It is part of the larger mypy-boto3-builder project, which frequently releases updates to keep pace with new boto3 versions and AWS service changes. The current version of mypy-boto3-fsx is 1.42.3, corresponding to a specific boto3 version.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","types","stubs","fsx","type-checking","dev-tool"],"install":[{"cmd":"pip install mypy-boto3-fsx boto3 mypy","lang":"bash","label":"Install for runtime, stubs, and type checker"}],"dependencies":[{"reason":"Required at runtime; mypy-boto3-fsx only provides type stubs.","package":"boto3","optional":false},{"reason":"Required for static type checking; mypy-boto3-fsx provides stubs for mypy.","package":"mypy","optional":true}],"imports":[{"symbol":"FSxClient","correct":"from mypy_boto3_fsx.client import FSxClient"},{"note":"Client types are nested under the '.client' submodule.","wrong":"from mypy_boto3_fsx import FSxClient","symbol":"Client","correct":"from mypy_boto3_fsx.client import FSxClient"}],"quickstart":{"code":"from typing import TYPE_CHECKING\nimport boto3\nimport os\n\nif TYPE_CHECKING:\n    from mypy_boto3_fsx.client import FSxClient\n\nsession = boto3.Session(\n    aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY'),\n    aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET'),\n    region_name=os.environ.get('AWS_REGION', 'us-east-1')\n)\n\n# Instantiate the FSx client with type hinting\nfsx_client: FSxClient = session.client(\"fsx\")\n\n# Example usage (runtime check)\ntry:\n    response = fsx_client.describe_file_systems()\n    print(\"Successfully described FSx file systems (runtime check passed).\")\n    # For type checking purposes, you can inspect 'response' type here\n    # For example: print(response.get('FileSystems'))\nexcept Exception as e:\n    print(f\"Runtime error during FSx client call: {e}\")\n\n# Type checking example (this block is only for mypy)\nif TYPE_CHECKING:\n    # mypy will verify the type of 'fsx_client'\n    # For example, it will suggest methods like 'create_file_system'\n    _ = fsx_client.create_file_system\n    print(\"FSxClient type definitions available for mypy.\")\n","lang":"python","description":"This quickstart demonstrates how to initialize a boto3 FSx client and apply type hints using `mypy-boto3-fsx`. The `if TYPE_CHECKING:` block ensures that the type imports are only processed by static analysis tools like Mypy, preventing runtime overhead or import errors if the stub package isn't installed in the runtime environment. Replace 'DUMMY_KEY' and 'DUMMY_SECRET' with actual AWS credentials for runtime execution."},"warnings":[{"fix":"Ensure your project uses Python 3.9 or newer. Upgrade your Python environment if necessary.","message":"Python 3.8 support has been removed in mypy-boto3-builder version 8.12.0. All generated type stub packages, including mypy-boto3-fsx, now require Python 3.9 or higher.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0 (and dependent mypy-boto3-* packages)"},{"fix":"Ensure your `mypy` configuration (e.g., `mypy.ini`, `pyproject.toml`) is up-to-date and correctly discovers stubs. Most users should not need to explicitly configure stub paths for PEP 561 packages.","message":"As of mypy-boto3-builder 8.12.0, all generated packages are now PEP 561 compliant. While this improves standard stub discovery, users relying on older `mypy` configurations or custom stub paths might need to verify their setup.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0 (and dependent mypy-boto3-* packages)"},{"fix":"Always install `mypy-boto3-fsx` with a version that corresponds to your `boto3` installation (e.g., if you use `boto3==1.28.0`, try `mypy-boto3-fsx==1.28.0`). Check PyPI for available versions.","message":"The version of `mypy-boto3-fsx` (e.g., `1.42.3`) should ideally match the version of `boto3` you have installed. Installing a mismatched version can lead to incorrect or missing type definitions, as the stubs are generated specifically for a particular boto3 API version.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always install both `boto3` and `mypy-boto3-fsx` in your development environment. Use `if TYPE_CHECKING:` guards to prevent unnecessary stub package imports at runtime.","message":"`mypy-boto3-fsx` provides only type stubs, not a functional client. You must have `boto3` installed for the code to run at runtime. The stubs are only for static type checking.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}