xref: /aosp_15_r20/external/pigweed/pw_build/python_gn_args.gni (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1*61c4878aSAndroid Build Coastguard Worker# Copyright 2022 The Pigweed Authors
2*61c4878aSAndroid Build Coastguard Worker#
3*61c4878aSAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4*61c4878aSAndroid Build Coastguard Worker# use this file except in compliance with the License. You may obtain a copy of
5*61c4878aSAndroid Build Coastguard Worker# the License at
6*61c4878aSAndroid Build Coastguard Worker#
7*61c4878aSAndroid Build Coastguard Worker#     https://www.apache.org/licenses/LICENSE-2.0
8*61c4878aSAndroid Build Coastguard Worker#
9*61c4878aSAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
10*61c4878aSAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11*61c4878aSAndroid Build Coastguard Worker# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12*61c4878aSAndroid Build Coastguard Worker# License for the specific language governing permissions and limitations under
13*61c4878aSAndroid Build Coastguard Worker# the License.
14*61c4878aSAndroid Build Coastguard Worker
15*61c4878aSAndroid Build Coastguard Workerimport("//build_overrides/pigweed.gni")
16*61c4878aSAndroid Build Coastguard Worker
17*61c4878aSAndroid Build Coastguard Workerdeclare_args() {
18*61c4878aSAndroid Build Coastguard Worker  # Python tasks, such as running tests and Pylint, are done in a single GN
19*61c4878aSAndroid Build Coastguard Worker  # toolchain to avoid unnecessary duplication in the build.
20*61c4878aSAndroid Build Coastguard Worker  pw_build_PYTHON_TOOLCHAIN = "$dir_pw_build/python_toolchain:python"
21*61c4878aSAndroid Build Coastguard Worker
22*61c4878aSAndroid Build Coastguard Worker  # Default gn build virtualenv target.
23*61c4878aSAndroid Build Coastguard Worker  pw_build_PYTHON_BUILD_VENV = "$dir_pw_env_setup:pigweed_build_venv"
24*61c4878aSAndroid Build Coastguard Worker
25*61c4878aSAndroid Build Coastguard Worker  # DOCSTAG: [default-pip-gn-args]
26*61c4878aSAndroid Build Coastguard Worker  # Set pw_python_venv.vendor_wheel targets to download Python packages for all
27*61c4878aSAndroid Build Coastguard Worker  # platform combinations. This takes a significant amount of time.
28*61c4878aSAndroid Build Coastguard Worker  pw_build_PYTHON_PIP_DOWNLOAD_ALL_PLATFORMS = false
29*61c4878aSAndroid Build Coastguard Worker
30*61c4878aSAndroid Build Coastguard Worker  # Adds '--require-hashes'. This option enforces hash checking on Python
31*61c4878aSAndroid Build Coastguard Worker  # package files.
32*61c4878aSAndroid Build Coastguard Worker  pw_build_PYTHON_PIP_INSTALL_REQUIRE_HASHES = false
33*61c4878aSAndroid Build Coastguard Worker
34*61c4878aSAndroid Build Coastguard Worker  # Adds --no-index forcing pip to not reach out to the internet (pypi.org) to
35*61c4878aSAndroid Build Coastguard Worker  # download packages. Using this option requires setting
36*61c4878aSAndroid Build Coastguard Worker  # pw_build_PYTHON_PIP_INSTALL_FIND_LINKS as well.
37*61c4878aSAndroid Build Coastguard Worker  pw_build_PYTHON_PIP_INSTALL_OFFLINE = false
38*61c4878aSAndroid Build Coastguard Worker
39*61c4878aSAndroid Build Coastguard Worker  # Adds '--no-cache-dir' forcing pip to ignore any previously cached Python
40*61c4878aSAndroid Build Coastguard Worker  # packages. On most systems this is located in ~/.cache/pip/
41*61c4878aSAndroid Build Coastguard Worker  pw_build_PYTHON_PIP_INSTALL_DISABLE_CACHE = false
42*61c4878aSAndroid Build Coastguard Worker
43*61c4878aSAndroid Build Coastguard Worker  # List of paths to folders containing Python wheels (*.whl) or source tar
44*61c4878aSAndroid Build Coastguard Worker  # files (*.tar.gz). Pip will check each of these directories when looking for
45*61c4878aSAndroid Build Coastguard Worker  # potential install candidates. Each path will be passed to all 'pip install'
46*61c4878aSAndroid Build Coastguard Worker  # commands as '--find-links PATH'.
47*61c4878aSAndroid Build Coastguard Worker  pw_build_PYTHON_PIP_INSTALL_FIND_LINKS = []
48*61c4878aSAndroid Build Coastguard Worker
49*61c4878aSAndroid Build Coastguard Worker  # General options passed to pip commands
50*61c4878aSAndroid Build Coastguard Worker  # https://pip.pypa.io/en/stable/cli/pip/#general-options
51*61c4878aSAndroid Build Coastguard Worker  pw_build_PYTHON_PIP_DEFAULT_OPTIONS = [ "--disable-pip-version-check" ]
52*61c4878aSAndroid Build Coastguard Worker
53*61c4878aSAndroid Build Coastguard Worker  # DOCSTAG: [default-pip-gn-args]
54*61c4878aSAndroid Build Coastguard Worker}
55