aboutsummaryrefslogtreecommitdiff
path: root/pw_arduino_build
diff options
context:
space:
mode:
authorWyatt Hepler <hepler@google.com>2020-10-22 08:32:13 -0700
committerCQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>2020-10-22 21:12:11 +0000
commit01a85d6b0edfd976203920607f62ee338f3599b8 (patch)
tree5d1bb693af8fbaca47da3d484bdf51773f292ebe /pw_arduino_build
parent0b6a5021623988f7720c266a5344de5aff0a6618 (diff)
downloadpigweed-01a85d6b0edfd976203920607f62ee338f3599b8.tar.gz
Python: Generate BUILD.gn files for Python packages
- Generate BUILD.gn files with pw_python_packages using pw_build.generate_python_package_gn. - Add the new pw_python_package targets to the default build. - Remove the unncecessary "python_packages" group. - Fix some Windows path issues in Python tests. Change-Id: I50c9b1f650652554f0836cbdc1781a00ec7e8e56 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22203 Commit-Queue: Wyatt Hepler <hepler@google.com> Reviewed-by: Rob Mohr <mohrr@google.com>
Diffstat (limited to 'pw_arduino_build')
-rw-r--r--pw_arduino_build/py/BUILD.gn38
-rw-r--r--pw_arduino_build/py/file_operations_test.py8
2 files changed, 42 insertions, 4 deletions
diff --git a/pw_arduino_build/py/BUILD.gn b/pw_arduino_build/py/BUILD.gn
new file mode 100644
index 000000000..c0f2e0052
--- /dev/null
+++ b/pw_arduino_build/py/BUILD.gn
@@ -0,0 +1,38 @@
+# Copyright 2020 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+import("//build_overrides/pigweed.gni")
+
+import("$dir_pw_build/python.gni")
+
+pw_python_package("py") {
+ setup = [ "setup.py" ]
+ sources = [
+ "pw_arduino_build/__init__.py",
+ "pw_arduino_build/__main__.py",
+ "pw_arduino_build/builder.py",
+ "pw_arduino_build/core_installer.py",
+ "pw_arduino_build/file_operations.py",
+ "pw_arduino_build/log.py",
+ "pw_arduino_build/teensy_detector.py",
+ "pw_arduino_build/unit_test_client.py",
+ "pw_arduino_build/unit_test_runner.py",
+ "pw_arduino_build/unit_test_server.py",
+ ]
+ tests = [
+ "builder_test.py",
+ "file_operations_test.py",
+ ]
+ python_deps = [ "$dir_pw_cli/py" ]
+}
diff --git a/pw_arduino_build/py/file_operations_test.py b/pw_arduino_build/py/file_operations_test.py
index 9d1fe03cd..bd387b9f2 100644
--- a/pw_arduino_build/py/file_operations_test.py
+++ b/pw_arduino_build/py/file_operations_test.py
@@ -58,16 +58,16 @@ class TestFileOperations(unittest.TestCase):
"sources recursive", file_set(), ["**/*.ino", "**/*.h", "**/*.cpp"],
[
"app.ino",
- "core/pwm/pulse.h",
- "libraries/b.cpp",
- "libraries/c.h",
+ os.path.join("core", "pwm", "pulse.h"),
+ os.path.join("libraries", "b.cpp"),
+ os.path.join("libraries", "c.h"),
]
),
(
"directories recursive", file_set(), ["**"],
[
"core",
- "core/pwm",
+ os.path.join("core", "pwm"),
"libraries",
]
),