How to make ansible-test work with mypy code

20 views
Skip to first unread message

Richard Megginson

unread,
Dec 19, 2023, 5:12:53 PM12/19/23
to ansible...@googlegroups.com
I'm using the latest ansible-test.  Here is the code:

def cmd_options_params_definition() -> dict[str, Any]:
...

here are the errors:

Running sanity test "import" on Python 3.6
ERROR: plugins/module_utils/ha_cluster_lsr/pcs_api_v2_utils.py:93:0: traceback: TypeError: 'type' object is not subscriptable
...
Running sanity test "import" on Python 3.7
ERROR: plugins/module_utils/ha_cluster_lsr/pcs_api_v2_utils.py:93:0: traceback: TypeError: 'type' object is not subscriptable
...
Running sanity test "import" on Python 3.8
ERROR: plugins/module_utils/ha_cluster_lsr/pcs_api_v2_utils.py:93:0: traceback: TypeError: 'type' object is not subscriptable


I suppose I could create a tests/config.yml with

modules:
  python_requires: ">= 3.9"

but that seems like a pretty big hammer . . . hoping there is another way to handle this.
Reply all
Reply to author
Forward
0 new messages