From: John Mulligan Date: Sat, 20 Jan 2024 15:45:31 +0000 (-0500) Subject: src/mypy.ini: disable namespace packages X-Git-Tag: v19.3.0~130^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f557827011e93d836f4334ca9c4efd5b9ef70c9b;p=ceph.git src/mypy.ini: disable namespace packages Configure mypy not to use namespace packages as the cython source dirs in src/pybind/{cephfs,rados,rbd}, etc. confuse mypy into thinking it's an empty namespace package rather than a missing module. Found using mypy 0.990. Signed-off-by: John Mulligan --- diff --git a/src/mypy.ini b/src/mypy.ini index bd4b436b4926..ce3e4a2ff4bb 100755 --- a/src/mypy.ini +++ b/src/mypy.ini @@ -6,6 +6,10 @@ check_untyped_defs = True show_error_context = True allow_redefinition = True disallow_untyped_defs = True +# Disable namespace packages as the cephfs, rados, rbd, etc. dirs lack an +# __init__.py and thus confuse mypy 0.990 (and up) into thinking these are +# empty namespaces causing the ignore_missing_imports rules to stop working. +namespace_packages = False [mypy-rados] # This would require a rados.pyi file