pw_build: Restore previous Mypy default behavior

The --namespace-packages option is enabled by default starting in Mypy
0.991. This caused mypy to incorrectly resolve module names for some
source files on a few systems.

This changes restores the previous default mypy behavior by disabling
namespace packages.

Bug: b/265836842
Change-Id: I97e5c5e257b69e3f8c753ceaf1c4b00ac9e0b3e3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/126672
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
diff --git a/pw_build/python.gni b/pw_build/python.gni
index e051161..357f375 100644
--- a/pw_build/python.gni
+++ b/pw_build/python.gni
@@ -71,6 +71,11 @@
     args = [
       "--pretty",
       "--show-error-codes",
+
+      # TODO(b/265836842): Namespace packages are enabled by default starting in
+      #     mypy 0.991. This caused problems in some configurations, so return
+      #     to the prior behavior for now.
+      "--no-namespace-packages",
     ]
 
     if (defined(invoker.mypy_ini)) {