]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
src/mypy.ini: disable namespace packages
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 20 Jan 2024 15:45:31 +0000 (10:45 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 23 Jan 2024 14:45:40 +0000 (09:45 -0500)
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 <jmulligan@redhat.com>
src/mypy.ini

index bd4b436b492666756134c55df6a0a1c56d8653e6..ce3e4a2ff4bbb7494a419437d711d5b2db74e5ec 100755 (executable)
@@ -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