xref: /aosp_15_r20/external/bazelbuild-rules_python/.bazelrc (revision 60517a1edbc8ecf509223e9af94a7adec7d736b8)
1*60517a1eSAndroid Build Coastguard Worker# For bazel-in-bazel testing
2*60517a1eSAndroid Build Coastguard Worker# Trick bazel into treating BUILD files under examples/* as being regular files
3*60517a1eSAndroid Build Coastguard Worker# This lets us glob() up all the files inside the examples to make them inputs to tests
4*60517a1eSAndroid Build Coastguard Worker# (Note, we cannot use `common --deleted_packages` because the bazel version command doesn't support it)
5*60517a1eSAndroid Build Coastguard Worker# To update these lines, execute
6*60517a1eSAndroid Build Coastguard Worker# `bazel run @rules_bazel_integration_test//tools:update_deleted_packages`
7*60517a1eSAndroid Build Coastguard Workerbuild --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/patches,examples/bzlmod/py_proto_library,examples/bzlmod/py_proto_library/example.com/another_proto,examples/bzlmod/py_proto_library/example.com/proto,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/another_proto,examples/py_proto_library/example.com/proto,gazelle,gazelle/manifest,gazelle/manifest/generate,gazelle/manifest/hasher,gazelle/manifest/test,gazelle/modules_mapping,gazelle/python,gazelle/pythonconfig,gazelle/python/private,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/custom_commands,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/local_toolchains,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/py_cc_toolchain_registered
8*60517a1eSAndroid Build Coastguard Workerquery --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/patches,examples/bzlmod/py_proto_library,examples/bzlmod/py_proto_library/example.com/another_proto,examples/bzlmod/py_proto_library/example.com/proto,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/another_proto,examples/py_proto_library/example.com/proto,gazelle,gazelle/manifest,gazelle/manifest/generate,gazelle/manifest/hasher,gazelle/manifest/test,gazelle/modules_mapping,gazelle/python,gazelle/pythonconfig,gazelle/python/private,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/custom_commands,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/local_toolchains,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/py_cc_toolchain_registered
9*60517a1eSAndroid Build Coastguard Worker
10*60517a1eSAndroid Build Coastguard Workertest --test_output=errors
11*60517a1eSAndroid Build Coastguard Worker
12*60517a1eSAndroid Build Coastguard Worker# Do NOT implicitly create empty __init__.py files in the runfiles tree.
13*60517a1eSAndroid Build Coastguard Worker# By default, these are created in every directory containing Python source code
14*60517a1eSAndroid Build Coastguard Worker# or shared libraries, and every parent directory of those directories,
15*60517a1eSAndroid Build Coastguard Worker# excluding the repo root directory. With this flag set, we are responsible for
16*60517a1eSAndroid Build Coastguard Worker# creating (possibly empty) __init__.py files and adding them to the srcs of
17*60517a1eSAndroid Build Coastguard Worker# Python targets as required.
18*60517a1eSAndroid Build Coastguard Workerbuild --incompatible_default_to_explicit_init_py
19*60517a1eSAndroid Build Coastguard Worker
20*60517a1eSAndroid Build Coastguard Worker# Ensure ongoing compatibility with this flag.
21*60517a1eSAndroid Build Coastguard Workercommon --incompatible_disallow_struct_provider_syntax
22*60517a1eSAndroid Build Coastguard Worker
23*60517a1eSAndroid Build Coastguard Worker# Windows makes use of runfiles for some rules
24*60517a1eSAndroid Build Coastguard Workerbuild --enable_runfiles
25*60517a1eSAndroid Build Coastguard Worker
26*60517a1eSAndroid Build Coastguard Worker# Make Bazel 6 use bzlmod by default
27*60517a1eSAndroid Build Coastguard Workercommon --enable_bzlmod
28*60517a1eSAndroid Build Coastguard Worker
29*60517a1eSAndroid Build Coastguard Worker# Additional config to use for readthedocs builds.
30*60517a1eSAndroid Build Coastguard Worker# See .readthedocs.yml for additional flags that can only be determined from
31*60517a1eSAndroid Build Coastguard Worker# the runtime environment.
32*60517a1eSAndroid Build Coastguard Workerbuild:rtd --stamp
33*60517a1eSAndroid Build Coastguard Worker# Some bzl files contain repos only available under bzlmod
34*60517a1eSAndroid Build Coastguard Workerbuild:rtd --enable_bzlmod
35*60517a1eSAndroid Build Coastguard Worker
36*60517a1eSAndroid Build Coastguard Workerbuild --lockfile_mode=update
37