xref: /aosp_15_r20/external/pigweed/pw_build/py/BUILD.gn (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2020 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15import("//build_overrides/pigweed.gni")
16
17import("$dir_pw_build/python.gni")
18
19pw_python_package("py") {
20  setup = [
21    "pyproject.toml",
22    "setup.cfg",
23  ]
24  sources = [
25    "pw_build/__init__.py",
26    "pw_build/bazel_query.py",
27    "pw_build/bazel_to_gn.py",
28    "pw_build/build_recipe.py",
29    "pw_build/collect_wheels.py",
30    "pw_build/copy_and_patch.py",
31    "pw_build/copy_from_cipd.py",
32    "pw_build/create_gn_venv.py",
33    "pw_build/create_python_tree.py",
34    "pw_build/error.py",
35    "pw_build/exec.py",
36    "pw_build/file_prefix_map.py",
37    "pw_build/generate_cc_blob_library.py",
38    "pw_build/generate_modules_lists.py",
39    "pw_build/generate_python_package.py",
40    "pw_build/generate_python_package_gn.py",
41    "pw_build/generate_python_requirements.py",
42    "pw_build/generate_python_wheel.py",
43    "pw_build/generate_python_wheel_cache.py",
44    "pw_build/generate_report.py",
45    "pw_build/generated_tests.py",
46    "pw_build/gn_resolver.py",
47    "pw_build/gn_target.py",
48    "pw_build/gn_writer.py",
49    "pw_build/host_tool.py",
50    "pw_build/merge_profraws.py",
51    "pw_build/mirror_tree.py",
52    "pw_build/nop.py",
53    "pw_build/pigweed_upstream_build.py",
54    "pw_build/pip_install_python_deps.py",
55    "pw_build/project_builder.py",
56    "pw_build/project_builder_argparse.py",
57    "pw_build/project_builder_context.py",
58    "pw_build/project_builder_prefs.py",
59    "pw_build/project_builder_presubmit_runner.py",
60    "pw_build/python_package.py",
61    "pw_build/python_runner.py",
62    "pw_build/wrap_ninja.py",
63    "pw_build/zip.py",
64  ]
65  tests = [
66    "bazel_query_test.py",
67    "build_recipe_test.py",
68    "bazel_to_gn_test.py",
69    "create_python_tree_test.py",
70    "file_prefix_map_test.py",
71    "generate_cc_blob_library_test.py",
72    "gn_target_test.py",
73    "gn_writer_test.py",
74    "project_builder_prefs_test.py",
75    "python_runner_test.py",
76    "zip_test.py",
77  ]
78  python_deps = [
79    "$dir_pw_cli/py",
80    "$dir_pw_config_loader/py",
81    "$dir_pw_env_setup/py",
82    "$dir_pw_presubmit/py",
83  ]
84  python_test_deps = [ "gn_tests:test_dist1" ]
85  pylintrc = "$dir_pigweed/.pylintrc"
86  mypy_ini = "$dir_pigweed/.mypy.ini"
87  ruff_toml = "$dir_pigweed/.ruff.toml"
88}
89