mirror of
https://github.com/ansible/ansible.git
synced 2026-02-03 20:40:24 -05:00
The stubs are taken from the unmerged PR [[1]] upstream. MyPy is set up to rely on them instead of the missing package type annotations. [1]: https://github.com/pypa/distlib/pull/195
146 lines
3.2 KiB
INI
146 lines
3.2 KiB
INI
# IMPORTANT
|
|
# Set "ignore_missing_imports" per package below, rather than globally.
|
|
# That will help identify missing type stubs that should be added to the sanity test environment.
|
|
|
|
[mypy]
|
|
# There are ~20 errors reported in ansible-core when strict optional checking is enabled.
|
|
# Until the number of occurrences are reduced, it's better to disable strict checking.
|
|
strict_optional = False
|
|
# There are ~70 errors reported in ansible-core when checking attributes.
|
|
# Until the number of occurrences are reduced, it's better to disable the check.
|
|
# The safe-super rule is disabled because it reports false positives on methods which return None.
|
|
# The type-abstract code is ignored due to false positives.
|
|
# See: https://github.com/python/mypy/issues/4717
|
|
disable_error_code = attr-defined,safe-super,type-abstract
|
|
|
|
mypy_path = ${MYPY_CONFIG_FILE_DIR}/_type_stubs
|
|
|
|
# Some controller unit tests use ansible_collections imports, both real and test-specific.
|
|
# The real imports are not currently visible to mypy.
|
|
# There's little point in exposing the test-specific imports.
|
|
[mypy-ansible_collections.*]
|
|
ignore_missing_imports = True
|
|
|
|
# Some unit tests for ansible-test use ansible_test imports, which are not currently visible to mypy.
|
|
[mypy-ansible_test.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-ansible.galaxy.collection.galaxy_api_proxy]
|
|
strict_optional = True
|
|
|
|
[mypy-ansible.galaxy.collection.gpg]
|
|
strict_optional = True
|
|
|
|
[mypy-ansible.galaxy.dependency_resolution.*]
|
|
strict_optional = True
|
|
|
|
[mypy-ansible.module_utils.six.moves.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-pkg_resources.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-coverage.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-passlib.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-pexpect.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-pypsrp.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-winrm.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-kerberos.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-xmltodict.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-md5.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-tomli_w.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-imp.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-scp.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-ncclient.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-lxml.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-rpmUtils.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-rpm.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-psutil.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-dnf.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-apt.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-apt_pkg.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-gssapi.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-_ssl.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-urllib_gssapi.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-systemd.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-sha.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-distro.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-urlparse.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-argcomplete.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-selinux.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-httplib.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-compiler.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-aptsources.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-urllib3.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-requests.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-jinja2.nativetypes]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-debugpy]
|
|
ignore_missing_imports = True
|