Python: Add py.typed files per PEP 561

- PEP 561 (https://www.python.org/dev/peps/pep-0561/) specifies that
  packages that wish to support type checking must provide a py.typed
  marker file. Add py.typed to all packages.
- Add missing __init__.py files to pw_cli and pw_hdlc_lite.

Change-Id: I32d652222e9909a5ac4a5612c2dd1683b18b2d36
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22200
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
diff --git a/pw_allocator/py/pw_allocator/py.typed b/pw_allocator/py/pw_allocator/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_allocator/py/pw_allocator/py.typed
diff --git a/pw_allocator/py/setup.py b/pw_allocator/py/setup.py
index 1d94f71..9625741 100644
--- a/pw_allocator/py/setup.py
+++ b/pw_allocator/py/setup.py
@@ -22,5 +22,9 @@
     author_email='pigweed-developers@googlegroups.com',
     description='Pigweed heap allocator',
     packages=setuptools.find_packages(),
-    install_requires=[],
+    package_data={'pw_allocator': ['py.typed']},
+    zip_safe=False,
+    install_requires=[
+        # 'pw_cli',
+    ],
 )
diff --git a/pw_arduino_build/py/pw_arduino_build/py.typed b/pw_arduino_build/py/pw_arduino_build/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_arduino_build/py/pw_arduino_build/py.typed
diff --git a/pw_arduino_build/py/setup.py b/pw_arduino_build/py/setup.py
index 7761fd9..13af5fc 100644
--- a/pw_arduino_build/py/setup.py
+++ b/pw_arduino_build/py/setup.py
@@ -22,6 +22,8 @@
     author_email='pigweed-developers@googlegroups.com',
     description='Target-specific python scripts for the arduino target',
     packages=setuptools.find_packages(),
+    package_data={'pw_arduino_build': ['py.typed']},
+    zip_safe=False,
     entry_points={
         'console_scripts': [
             'arduino_builder = pw_arduino_build.__main__:main',
diff --git a/pw_bloat/py/pw_bloat/py.typed b/pw_bloat/py/pw_bloat/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_bloat/py/pw_bloat/py.typed
diff --git a/pw_bloat/py/setup.py b/pw_bloat/py/setup.py
index 29545a8..73410da 100644
--- a/pw_bloat/py/setup.py
+++ b/pw_bloat/py/setup.py
@@ -22,4 +22,6 @@
     author_email='pigweed-developers@googlegroups.com',
     description='Tools for generating binary size report cards',
     packages=setuptools.find_packages(),
+    package_data={'pw_bloat': ['py.typed']},
+    zip_safe=False,
 )
diff --git a/pw_build/py/pw_build/py.typed b/pw_build/py/pw_build/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_build/py/pw_build/py.typed
diff --git a/pw_build/py/setup.py b/pw_build/py/setup.py
index 755b4c0..c8fc23e 100644
--- a/pw_build/py/setup.py
+++ b/pw_build/py/setup.py
@@ -22,6 +22,8 @@
     author_email='pigweed-developers@googlegroups.com',
     description='Python scripts that support the GN build',
     packages=setuptools.find_packages(),
+    package_data={'pw_build': ['py.typed']},
+    zip_safe=False,
     install_requires=[
         'wheel',
     ],
diff --git a/pw_cli/py/pw_cli/__init__.py b/pw_cli/py/pw_cli/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_cli/py/pw_cli/__init__.py
diff --git a/pw_cli/py/pw_cli/py.typed b/pw_cli/py/pw_cli/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_cli/py/pw_cli/py.typed
diff --git a/pw_cli/py/setup.py b/pw_cli/py/setup.py
index d9a163b..19827b3 100644
--- a/pw_cli/py/setup.py
+++ b/pw_cli/py/setup.py
@@ -22,5 +22,7 @@
     author_email='pigweed-developers@googlegroups.com',
     description='Pigweed swiss-army knife',
     packages=setuptools.find_packages(),
+    package_data={'pw_cli': ['py.typed']},
+    zip_safe=False,
     entry_points={'console_scripts': ['pw = pw_cli.__main__:main']},
 )
diff --git a/pw_doctor/py/pw_doctor/py.typed b/pw_doctor/py/pw_doctor/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_doctor/py/pw_doctor/py.typed
diff --git a/pw_doctor/py/setup.py b/pw_doctor/py/setup.py
index 2c61210..bc80827 100644
--- a/pw_doctor/py/setup.py
+++ b/pw_doctor/py/setup.py
@@ -22,4 +22,6 @@
     author_email='pigweed-developers@googlegroups.com',
     description='Environment check script for Pigweed',
     packages=setuptools.find_packages(),
+    package_data={'pw_doctor': ['py.typed']},
+    zip_safe=False,
 )
diff --git a/pw_env_setup/py/pw_env_setup/py.typed b/pw_env_setup/py/pw_env_setup/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_env_setup/py/pw_env_setup/py.typed
diff --git a/pw_env_setup/py/setup.py b/pw_env_setup/py/setup.py
index f178fa0..b50b414 100644
--- a/pw_env_setup/py/setup.py
+++ b/pw_env_setup/py/setup.py
@@ -27,6 +27,7 @@
     },
     package_data={
         'pw_env_setup': [
+            'py.typed',
             'cargo_setup/packages.txt',
             'cipd_setup/luci.json',
             'cipd_setup/pigweed.json',
@@ -34,4 +35,5 @@
             'virtualenv_setup/requirements.txt',
         ],
     },
+    zip_safe=False,
 )
diff --git a/pw_hdlc_lite/py/pw_hdlc_lite/__init__.py b/pw_hdlc_lite/py/pw_hdlc_lite/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_hdlc_lite/py/pw_hdlc_lite/__init__.py
diff --git a/pw_hdlc_lite/py/pw_hdlc_lite/py.typed b/pw_hdlc_lite/py/pw_hdlc_lite/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_hdlc_lite/py/pw_hdlc_lite/py.typed
diff --git a/pw_hdlc_lite/py/setup.py b/pw_hdlc_lite/py/setup.py
index ddb2075..15266ae 100644
--- a/pw_hdlc_lite/py/setup.py
+++ b/pw_hdlc_lite/py/setup.py
@@ -22,6 +22,8 @@
     author_email='pigweed-developers@googlegroups.com',
     description='Tools for Encoding/Decoding data using the HDLC-Lite protocol',
     packages=setuptools.find_packages(),
+    package_data={'pw_hdlc_lite': ['py.typed']},
+    zip_safe=False,
     install_requires=['ipython'],
     tests_require=['pw_build'],
 )
diff --git a/pw_module/py/pw_module/py.typed b/pw_module/py/pw_module/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_module/py/pw_module/py.typed
diff --git a/pw_module/py/setup.py b/pw_module/py/setup.py
index a43fba3..5957252 100644
--- a/pw_module/py/setup.py
+++ b/pw_module/py/setup.py
@@ -22,4 +22,6 @@
     author_email='pigweed-developers@googlegroups.com',
     description='Meta-module for Pigweed',
     packages=setuptools.find_packages(),
+    package_data={'pw_module': ['py.typed']},
+    zip_safe=False,
 )
diff --git a/pw_presubmit/py/pw_presubmit/py.typed b/pw_presubmit/py/pw_presubmit/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_presubmit/py/pw_presubmit/py.typed
diff --git a/pw_presubmit/py/setup.py b/pw_presubmit/py/setup.py
index 439d8eb..3f97b96 100644
--- a/pw_presubmit/py/setup.py
+++ b/pw_presubmit/py/setup.py
@@ -27,4 +27,6 @@
         'yapf==0.30.0',
     ],
     packages=setuptools.find_packages(),
+    package_data={'pw_presubmit': ['py.typed']},
+    zip_safe=False,
 )
diff --git a/pw_protobuf/py/pw_protobuf/py.typed b/pw_protobuf/py/pw_protobuf/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_protobuf/py/pw_protobuf/py.typed
diff --git a/pw_protobuf/py/setup.py b/pw_protobuf/py/setup.py
index d1d617c..96a8209 100644
--- a/pw_protobuf/py/setup.py
+++ b/pw_protobuf/py/setup.py
@@ -22,6 +22,8 @@
     author_email='pigweed-developers@googlegroups.com',
     description='Lightweight streaming protobuf implementation',
     packages=setuptools.find_packages(),
+    package_data={'pw_protobuf': ['py.typed']},
+    zip_safe=False,
     entry_points={
         'console_scripts': ['pw_protobuf_codegen = pw_protobuf.plugin:main']
     },
diff --git a/pw_protobuf_compiler/py/pw_protobuf_compiler/py.typed b/pw_protobuf_compiler/py/pw_protobuf_compiler/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_protobuf_compiler/py/pw_protobuf_compiler/py.typed
diff --git a/pw_protobuf_compiler/py/setup.py b/pw_protobuf_compiler/py/setup.py
index 12edebb..189992f 100644
--- a/pw_protobuf_compiler/py/setup.py
+++ b/pw_protobuf_compiler/py/setup.py
@@ -22,6 +22,8 @@
     author_email='pigweed-developers@googlegroups.com',
     description='Pigweed protoc wrapper',
     packages=setuptools.find_packages(),
+    package_data={'pw_protobuf_compiler': ['py.typed']},
+    zip_safe=False,
     entry_points={
         'console_scripts':
         ['generate_protos = pw_protobuf_compiler.generate_protos:main']
diff --git a/pw_rpc/py/pw_rpc/py.typed b/pw_rpc/py/pw_rpc/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_rpc/py/pw_rpc/py.typed
diff --git a/pw_rpc/py/setup.py b/pw_rpc/py/setup.py
index 55e4515..708371b 100644
--- a/pw_rpc/py/setup.py
+++ b/pw_rpc/py/setup.py
@@ -22,6 +22,8 @@
     author_email='pigweed-developers@googlegroups.com',
     description='On-device remote procedure calls',
     packages=setuptools.find_packages(),
+    package_data={'pw_rpc': ['py.typed']},
+    zip_safe=False,
     entry_points={'console_scripts': ['pw_rpc_codegen = pw_rpc.plugin:main']},
     install_requires=[
         'protobuf',
diff --git a/pw_status/py/pw_status/py.typed b/pw_status/py/pw_status/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_status/py/pw_status/py.typed
diff --git a/pw_status/py/setup.py b/pw_status/py/setup.py
index eba46d6..13faaaf 100644
--- a/pw_status/py/setup.py
+++ b/pw_status/py/setup.py
@@ -22,4 +22,6 @@
     author_email='pigweed-developers@googlegroups.com',
     description='Pigweed Status object',
     packages=setuptools.find_packages(),
+    package_data={'pw_status': ['py.typed']},
+    zip_safe=False,
 )
diff --git a/pw_tokenizer/py/pw_tokenizer/py.typed b/pw_tokenizer/py/pw_tokenizer/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_tokenizer/py/pw_tokenizer/py.typed
diff --git a/pw_tokenizer/py/setup.py b/pw_tokenizer/py/setup.py
index 1520e50..04680f1 100644
--- a/pw_tokenizer/py/setup.py
+++ b/pw_tokenizer/py/setup.py
@@ -22,6 +22,8 @@
     author_email='pigweed-developers@googlegroups.com',
     description='Tools for decoding tokenized strings',
     packages=setuptools.find_packages(),
+    package_data={'pw_tokenizer': ['py.typed']},
+    zip_safe=False,
     test_suite='setup.test_suite',
     extra_requires=['serial'],
 )
diff --git a/pw_trace/py/pw_trace/py.typed b/pw_trace/py/pw_trace/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_trace/py/pw_trace/py.typed
diff --git a/pw_trace/py/setup.py b/pw_trace/py/setup.py
index a1371e5..9fa3379 100644
--- a/pw_trace/py/setup.py
+++ b/pw_trace/py/setup.py
@@ -22,5 +22,6 @@
     author_email='pigweed-developers@googlegroups.com',
     description='Tools for dealing with trace data',
     packages=setuptools.find_packages(),
-    test_suite='setup.test_suite',
+    package_data={'pw_trace': ['py.typed']},
+    zip_safe=False,
 )
diff --git a/pw_trace_tokenized/py/pw_trace_tokenized/py.typed b/pw_trace_tokenized/py/pw_trace_tokenized/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_trace_tokenized/py/pw_trace_tokenized/py.typed
diff --git a/pw_trace_tokenized/py/setup.py b/pw_trace_tokenized/py/setup.py
index 3266c84..cea2439 100644
--- a/pw_trace_tokenized/py/setup.py
+++ b/pw_trace_tokenized/py/setup.py
@@ -22,5 +22,6 @@
     author_email='pigweed-developers@googlegroups.com',
     description='pw_trace backend to tokenize trace events',
     packages=setuptools.find_packages(),
-    test_suite='setup.test_suite',
+    package_data={'pw_trace_tokenized': ['py.typed']},
+    zip_safe=False,
 )
diff --git a/pw_unit_test/py/pw_unit_test/py.typed b/pw_unit_test/py/pw_unit_test/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_unit_test/py/pw_unit_test/py.typed
diff --git a/pw_unit_test/py/setup.py b/pw_unit_test/py/setup.py
index 864b254..ea467d5 100644
--- a/pw_unit_test/py/setup.py
+++ b/pw_unit_test/py/setup.py
@@ -22,6 +22,8 @@
     author_email='pigweed-developers@googlegroups.com',
     description='Unit tests for Pigweed projects',
     packages=setuptools.find_packages(),
+    package_data={'pw_unit_test': ['py.typed']},
+    zip_safe=False,
     install_requires=[
         'pw_cli',
     ],
diff --git a/pw_watch/py/pw_watch/py.typed b/pw_watch/py/pw_watch/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_watch/py/pw_watch/py.typed
diff --git a/pw_watch/py/setup.py b/pw_watch/py/setup.py
index 4f5adfc..7958eab 100644
--- a/pw_watch/py/setup.py
+++ b/pw_watch/py/setup.py
@@ -22,6 +22,8 @@
     author_email='pigweed-developers@googlegroups.com',
     description='Pigweed automatic builder',
     packages=setuptools.find_packages(),
+    package_data={'pw_watch': ['py.typed']},
+    zip_safe=False,
     install_requires=[
         'watchdog',
     ],
diff --git a/targets/lm3s6965evb-qemu/py/lm3s6965evb_qemu_utils/py.typed b/targets/lm3s6965evb-qemu/py/lm3s6965evb_qemu_utils/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/targets/lm3s6965evb-qemu/py/lm3s6965evb_qemu_utils/py.typed
diff --git a/targets/lm3s6965evb-qemu/py/setup.py b/targets/lm3s6965evb-qemu/py/setup.py
index a297f52..4223685 100644
--- a/targets/lm3s6965evb-qemu/py/setup.py
+++ b/targets/lm3s6965evb-qemu/py/setup.py
@@ -23,6 +23,8 @@
     description=
     'Target-specific python scripts for the lm3s6965evb-qemu target',
     packages=setuptools.find_packages(),
+    package_data={'lm3s6965evb_qemu_utils': ['py.typed']},
+    zip_safe=False,
     entry_points={
         'console_scripts': [
             'lm3s6965evb_qemu_unit_test_runner = '
diff --git a/targets/stm32f429i-disc1/py/setup.py b/targets/stm32f429i-disc1/py/setup.py
index ffbc1d0..309ff7e 100644
--- a/targets/stm32f429i-disc1/py/setup.py
+++ b/targets/stm32f429i-disc1/py/setup.py
@@ -23,6 +23,8 @@
     description=
     'Target-specific python scripts for the stm32f429i-disc1 target',
     packages=setuptools.find_packages(),
+    package_data={'stm32f429i_disc1_utils': ['py.typed']},
+    zip_safe=False,
     entry_points={
         'console_scripts': [
             'stm32f429i_disc1_unit_test_runner = '
diff --git a/targets/stm32f429i-disc1/py/stm32f429i_disc1_utils/py.typed b/targets/stm32f429i-disc1/py/stm32f429i_disc1_utils/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/targets/stm32f429i-disc1/py/stm32f429i_disc1_utils/py.typed