Skip to content

Commit

Permalink
pw_build: Fix pw_python_venv generated requirements
Browse files Browse the repository at this point in the history
pw_python_venv was always adding the //pw_build/py gn target to the
list of dependencies to base the generated requirements on. This is
usually not an issue if pw_build is included. However if it isn't
needed extra 3p deps were always getting added from pw_build
regardless.

For example if a venv only needed //pw_docgen/py and //pw_status/py
the generated_requirements would include all these extra packages due
to pw_build being added in along with all their 3p deps:

  //pw_arduino_build/py:py
  //pw_build/py:py
  //pw_cli/py:py
  //pw_config_loader/py:py
  //pw_docgen/py:py
  //pw_env_setup/py:py
  //pw_package/py:py
  //pw_presubmit/py:py
  //pw_status/py:py
  //pw_stm32cube_build/py:py

This change fixes it so only these two are added:

  //pw_docgen/py:py
  //pw_status/py:py

Change-Id: I95c850c1532d70979acda23d84c0c47f8cbcad96
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/240792
Lint: Lint 🤖 <[email protected]>
Pigweed-Auto-Submit: Anthony DiGirolamo <[email protected]>
Docs-Not-Needed: Anthony DiGirolamo <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
Reviewed-by: Wyatt Hepler <[email protected]>
  • Loading branch information
AnthonyDiGirolamo authored and CQ Bot Account committed Oct 7, 2024
1 parent 29fc404 commit 87f43fe
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pw_build/python_venv.gni
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,10 @@ template("pw_python_venv") {
"($pw_build_PYTHON_TOOLCHAIN)" ]
}

# pw_build/py is always needed for venv creation and Python lint checks.
python_metadata_deps =
[ get_label_info("$dir_pw_build/py", "label_no_toolchain") +
"($pw_build_PYTHON_TOOLCHAIN)" ]
python_metadata_deps += _pkg_gn_labels
# Add target packages to the python_metadata_deps. This will let
# GN expand the transitive pw_python_package deps which are read
# by generate_python_requirements.py
python_metadata_deps = _pkg_gn_labels

args = [
"--gn-root-build-dir",
Expand Down

0 comments on commit 87f43fe

Please sign in to comment.