ScaleComputing / HyperCoreAnsibleCollection

Official Ansible collection for Scale Computing SC//HyperCore (HC3) v1 API
GNU General Public License v3.0
12 stars 8 forks source link

Add mypy to CI file #89

Closed domendobnikar closed 1 year ago

domendobnikar commented 1 year ago
justinc1 commented 1 year ago

One note @domendobnikar . There are still errors (https://github.com/ScaleComputing/HyperCoreAnsibleCollection/actions/runs/4082190817/jobs/7036274867)

plugins/module_utils/utils.py:33: in <module>
    input: dict[Any, Any], *field_names: str, ansible_hypercore_map: dict[Any, Any]
E   TypeError: 'type' object is not subscriptable

It should be Dict from typing, not dict, for python 3.8.

domendobnikar commented 1 year ago

It should be Dict from typing, not dict, for python 3.8.

Oh ok will fix.

PolonaM commented 1 year ago

One note @domendobnikar . There are still errors (https://github.com/ScaleComputing/HyperCoreAnsibleCollection/actions/runs/4082190817/jobs/7036274867)

plugins/module_utils/utils.py:33: in <module>
    input: dict[Any, Any], *field_names: str, ansible_hypercore_map: dict[Any, Any]
E   TypeError: 'type' object is not subscriptable

It should be Dict from typing, not dict, for python 3.8.

I think here we should decide if we use "from future import annotations" or using typing. I think the recomended way is to use the first one. What do you think?

domendobnikar commented 1 year ago

I think here we should decide if we use "from future import annotations" or using typing. I think the recomended way is to use the first one. What do you think?

We need to use from **future** import annotations to reference to the same class within the class itself; Example would be the Get methods. Not sure if it fixes this specific error.

PolonaM commented 1 year ago

I think here we should decide if we use "from future import annotations" or using typing. I think the recomended way is to use the first one. What do you think?

We need to use from **future** import annotations to reference to the same class within the class itself; Example would be the Get methods. Not sure if it fixes this specific error.

Also for the tuple vs Tuple, list vs List, dict vs Dict...