pw_build: Python build docs
- Document Python build automation as part of the general build system
docs.
- Document the Python GN templates in pw_build.
- Add links between relevant sections of docs.
Change-Id: I80dfbdf0e49a63eab232895afb91d05d95015613
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/33781
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Joe Ethier <jethier@google.com>
Reviewed-by: David Rogers <davidrogers@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
diff --git a/docs/module_structure.rst b/docs/module_structure.rst
index 3914557..49db88d 100644
--- a/docs/module_structure.rst
+++ b/docs/module_structure.rst
@@ -55,12 +55,14 @@
zip_test.cc
# Python files go into 'py/<module>/...'
- py/setup.py # All Python must be a Python module with setup.py
- py/foo_test.py # Tests go in py/ but outside of the Python module
+ py/BUILD.gn # Python packages are declared in GN using pw_python_package
+ py/setup.py # Python files are structured as standard Python packages
+ py/foo_test.py # Tests go in py/ but outside of the Python package
py/bar_test.py
py/pw_foo/__init__.py
py/pw_foo/__main__.py
py/pw_foo/bar.py
+ py/pw_foo/py.typed # Indicates that this package has type annotations
# Go files go into 'go/...'
go/...
@@ -342,6 +344,11 @@
* An optional config override header file would silently be excluded if the
file path were accidentally misspelled.
+Python module structure
+-----------------------
+Python code is structured as described in the :ref:`docs-python-build-structure`
+section of :ref:`docs-python-build`.
+
.. _docs-module-structure-facades:
Facades