pw_build: Don't require sources in pw_python_package
To simplify referring to third-party packages, no longer require listing
sources in pw_python_packages.
Change-Id: If7624f3a2dce413042dd531d39e0b04e91b67c0f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/25741
Reviewed-by: Zoltan Szatmary-Ban <szatmz@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
diff --git a/pw_build/python.gni b/pw_build/python.gni
index 9ca3a43..8a02985 100644
--- a/pw_build/python.gni
+++ b/pw_build/python.gni
@@ -55,8 +55,6 @@
_all_py_files += _test_sources
- assert(_all_py_files != [], "At least one source or test must be provided")
-
# pw_python_script uses pw_python_package, but with a limited set of features.
# _pw_standalone signals that this target is actually a pw_python_script.
_is_package = !(defined(invoker._pw_standalone) && invoker._pw_standalone)
@@ -78,7 +76,7 @@
}
# If sources are provided, make sure there is an __init__.py file.
- if (defined(invoker.sources)) {
+ if (defined(invoker.sources) && invoker.sources != []) {
assert(filter_include(invoker.sources, [ "*\b__init__.py" ]) != [],
"Python packages must have at least one __init__.py file")
}