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 <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2024-01-20 10:45:31 -05:00
parent aa42bf14cf
commit f557827011

View File

@ -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