From f557827011e93d836f4334ca9c4efd5b9ef70c9b Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sat, 20 Jan 2024 10:45:31 -0500 Subject: [PATCH] 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 --- src/mypy.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mypy.ini b/src/mypy.ini index bd4b436b492..ce3e4a2ff4b 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