From 71f2e777ed220026597a7980e7d273c80754bf68 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 9 Feb 2023 16:52:31 -0800 Subject: [PATCH] Update mypy to version 1.0.0 (#79963) --- lib/ansible/module_utils/basic.py | 4 ++-- lib/ansible/module_utils/common/yaml.py | 2 +- lib/ansible/module_utils/compat/typing.py | 2 +- .../_data/requirements/sanity.mypy.txt | 20 +++++++++---------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 67be7e489c5..742b5fc73ed 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -223,14 +223,14 @@ imap = map try: # Python 2 - unicode # type: ignore[has-type] # pylint: disable=used-before-assignment + unicode # type: ignore[used-before-def] # pylint: disable=used-before-assignment except NameError: # Python 3 unicode = text_type try: # Python 2 - basestring # type: ignore[has-type] # pylint: disable=used-before-assignment + basestring # type: ignore[used-before-def,has-type] # pylint: disable=used-before-assignment except NameError: # Python 3 basestring = string_types diff --git a/lib/ansible/module_utils/common/yaml.py b/lib/ansible/module_utils/common/yaml.py index 3a9caa6062c..b4d766bbee2 100644 --- a/lib/ansible/module_utils/common/yaml.py +++ b/lib/ansible/module_utils/common/yaml.py @@ -30,7 +30,7 @@ if HAS_YAML: except (ImportError, AttributeError): from yaml import SafeLoader # type: ignore[assignment] from yaml import SafeDumper # type: ignore[assignment] - from yaml.parser import Parser # type: ignore[misc] # pylint: disable=unused-import + from yaml.parser import Parser # type: ignore[assignment] # pylint: disable=unused-import yaml_load = _partial(_yaml.load, Loader=SafeLoader) yaml_load_all = _partial(_yaml.load_all, Loader=SafeLoader) diff --git a/lib/ansible/module_utils/compat/typing.py b/lib/ansible/module_utils/compat/typing.py index d3760bf2d67..036e6810cf4 100644 --- a/lib/ansible/module_utils/compat/typing.py +++ b/lib/ansible/module_utils/compat/typing.py @@ -19,7 +19,7 @@ except Exception: # pylint: disable=broad-except try: - cast + cast # type: ignore[used-before-def] except NameError: def cast(typ, val): # type: ignore[no-redef] return val diff --git a/test/lib/ansible_test/_data/requirements/sanity.mypy.txt b/test/lib/ansible_test/_data/requirements/sanity.mypy.txt index ba5699337d5..b0c0a80dbbb 100644 --- a/test/lib/ansible_test/_data/requirements/sanity.mypy.txt +++ b/test/lib/ansible_test/_data/requirements/sanity.mypy.txt @@ -1,19 +1,19 @@ # edit "sanity.mypy.in" and generate with: hacking/update-sanity-requirements.py --test mypy cffi==1.15.1 -cryptography==39.0.0 +cryptography==39.0.1 Jinja2==3.1.2 MarkupSafe==2.1.2 -mypy==0.991 -mypy-extensions==0.4.3 +mypy==1.0.0 +mypy-extensions==1.0.0 packaging==23.0 pycparser==2.21 tomli==2.0.1 types-backports==0.1.3 -types-docutils==0.19.1.2 -types-paramiko==2.12.0.3 -types-PyYAML==6.0.12.3 -types-requests==2.28.11.8 -types-setuptools==65.7.0.3 -types-toml==0.10.8.1 -types-urllib3==1.26.25.4 +types-docutils==0.19.1.3 +types-paramiko==3.0.0.2 +types-PyYAML==6.0.12.5 +types-requests==2.28.11.12 +types-setuptools==67.2.0.1 +types-toml==0.10.8.3 +types-urllib3==1.26.25.5 typing_extensions==4.4.0