Skip to content

Commit 7af481d

Browse files
committed
feat: Bzlmod refactor and allow for dynamic python interpreter target
This commit includes: - adding a new bzlmod_build_file_geration demo - adding the capabilty where python.toolchain create the symlink to set the pip python interperter target - improved documentation in the pip arguments
1 parent 81a200b commit 7af481d

33 files changed

+2281
-18
lines changed

.bazelci/presubmit.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ buildifier:
4848
test_targets: ["..."]
4949
.coverage_targets_example_bzlmod: &coverage_targets_example_bzlmod
5050
coverage_targets: ["//:test"]
51+
.coverage_targets_example_bzlmod_build_file_generation: &coverage_targets_example_bzlmod_build_file_generation
52+
coverage_targets: ["//:bzlmod_build_file_generation_test"]
5153
.coverage_targets_example_multi_python: &coverage_targets_example_multi_python
5254
coverage_targets:
5355
- //tests:my_lib_3_10_test
@@ -173,7 +175,7 @@ tasks:
173175
working_directory: examples/build_file_generation
174176
platform: windows
175177

176-
integration_test_bzlmod_ubuntu_min:
178+
integration_test_bzlmod_gazelle_ubuntu_min:
177179
<<: *minimum_supported_bzlmod_version
178180
<<: *reusable_build_test_all
179181
<<: *coverage_targets_example_bzlmod
@@ -205,6 +207,38 @@ tasks:
205207
working_directory: examples/bzlmod
206208
platform: windows
207209

210+
# integration_test_bzlmod_generate_build_file_generation_ubuntu_min:
211+
# <<: *minimum_supported_bzlmod_version
212+
# <<: *reusable_build_test_all
213+
# <<: *coverage_targets_example_bzlmod_build_file_generation
214+
# name: bzlmod integration tests on Ubuntu using minimum supported Bazel version
215+
# working_directory: examples/bzlmod_build_file_generation
216+
# platform: ubuntu2004
217+
integration_test_bzlmod_generation_build_files_ubuntu:
218+
<<: *reusable_build_test_all
219+
<<: *coverage_targets_example_bzlmod_build_file_generation
220+
name: bzlmod integration tests on Ubuntu
221+
working_directory: examples/bzlmod_build_file_generation
222+
platform: ubuntu2004
223+
# integration_test_bzlmod_build_file_generation_debian:
224+
# <<: *reusable_build_test_all
225+
# <<: *coverage_targets_example_bzlmod_build_file_generation
226+
# name: bzlmod integration tests on Debian
227+
# working_directory: examples/bzlmod_build_file_generation
228+
# platform: debian11
229+
# integration_test_bzlmod_build_file_generation_macos:
230+
# <<: *reusable_build_test_all
231+
# <<: *coverage_targets_example_bzlmod_build_file_generation
232+
# name: bzlmod integration tests on macOS
233+
# working_directory: examples/bzlmod_build_file_generation
234+
# platform: macos
235+
integration_test_bzlmod_build_file_generation_windows:
236+
<<: *reusable_build_test_all
237+
# coverage is not supported on Windows
238+
name: bzlmod integration tests on Windows
239+
working_directory: examples/bzlmod_build_file_generation
240+
platform: windows
241+
208242
integration_test_multi_python_versions_ubuntu_min:
209243
<<: *minimum_supported_version
210244
<<: *reusable_build_test_all

.bazelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# This lets us glob() up all the files inside the examples to make them inputs to tests
44
# (Note, we cannot use `common --deleted_packages` because the bazel version command doesn't support it)
55
# To update these lines, run tools/bazel_integration_test/update_deleted_packages.sh
6-
build --deleted_packages=examples/build_file_generation,examples/build_file_generation/get_url,examples/bzlmod,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/runfiles,examples/multi_python_versions,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_install,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_import,examples/py_proto_library,examples/relative_requirements,tests/compile_pip_requirements,tests/pip_repository_entry_points,tests/pip_deps
7-
query --deleted_packages=examples/build_file_generation,examples/build_file_generation/get_url,examples/bzlmod,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/runfiles,examples/multi_python_versions,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_install,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_import,examples/py_proto_library,examples/relative_requirements,tests/compile_pip_requirements,tests/pip_repository_entry_points,tests/pip_deps
6+
build --deleted_packages=examples/build_file_generation,examples/build_file_generation/get_url,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/bzlmod,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/runfiles,examples/multi_python_versions,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_install,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_import,examples/py_proto_library,examples/relative_requirements,tests/compile_pip_requirements,tests/pip_repository_entry_points,tests/pip_deps
7+
query --deleted_packages=examples/build_file_generation,examples/build_file_generation/get_url,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/bzlmod,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/runfiles,examples/multi_python_versions,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_install,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_import,examples/py_proto_library,examples/relative_requirements,tests/compile_pip_requirements,tests/pip_repository_entry_points,tests/pip_deps
88

99
test --test_output=errors
1010

docs/pip_repository.md

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/BUILD.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ bazel_integration_test(
2222
timeout = "long",
2323
)
2424

25+
bazel_integration_test(
26+
name = "bzlmod_build_file_generation_example",
27+
timeout = "long",
28+
)
29+
2530
bazel_integration_test(
2631
name = "pip_install_example",
2732
timeout = "long",

examples/build_file_generation/.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
test --test_output=errors
1+
test --test_output=errors --enable_runfiles
22

33
# Windows requires these for multi-python support:
44
build --enable_runfiles

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy