Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4a0ba3b

Browse filesBrowse files
authored
tests(pystar): CI configs that uses Starlark implementation of rules (bazel-contrib#1435)
Since Bazel 7 isn't yet available, and we need a couple recent commits in Bazel, the last_green release is used. This will eventually be changed to "rolling" once the necessary commits are available in the next rolling release. Because we're at the limit of 80 test jobs, some existing jobs have to be removed and only a limited number of cases can be currently covered. I opted to remove the pip_install tests, since they're redundant with the pip_parse tests, which frees up 4 slots. Two test configs are added: one using workspace, the other using bzlmod; both run the default tests on Ubuntu. This will provide some basic coverage; more slots will free up when Bazel 5.4 support is dropped and Bazel 7 is released. Work toward bazel-contrib#1069
1 parent 9a8c447 commit 4a0ba3b
Copy full SHA for 4a0ba3b

File tree

Expand file treeCollapse file tree

2 files changed

+49
-41
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+49
-41
lines changed

‎.bazelci/presubmit.yml

Copy file name to clipboardExpand all lines: .bazelci/presubmit.yml
+30-29Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,36 @@ tasks:
9393
<<: *reusable_config
9494
name: Default test on Ubuntu
9595
platform: ubuntu2004
96+
ubuntu_bazel_rolling:
97+
<<: *reusable_config
98+
name: "Default test: Ubuntu, Pystar, workspace"
99+
platform: ubuntu2004
100+
# TODO: Change to "rolling" once
101+
# https://github.com/bazelbuild/bazel/commit/f3aafea59ae021c6a12086cb2cd34c5fa782faf1
102+
# is available in rolling.
103+
bazel: "last_green"
104+
environment:
105+
RULES_PYTHON_ENABLE_PYSTAR: "1"
106+
test_flags:
107+
# The doc check tests fail because the Starlark implementation makes the
108+
# PyInfo and PyRuntimeInfo symbols become documented.
109+
- "--test_tag_filters=-integration-test,-doc_check_test"
110+
ubuntu_bazel_rolling_bzlmod:
111+
<<: *reusable_config
112+
<<: *common_bzlmod_flags
113+
name: "Default test: Ubuntu, Pystar, bzlmod"
114+
platform: ubuntu2004
115+
# TODO: Change to "rolling" once
116+
# https://github.com/bazelbuild/bazel/commit/f3aafea59ae021c6a12086cb2cd34c5fa782faf1
117+
# is available in rolling.
118+
bazel: "last_green"
119+
environment:
120+
RULES_PYTHON_ENABLE_PYSTAR: "1"
121+
test_flags:
122+
# The doc check tests fail because the Starlark implementation makes the
123+
# PyInfo and PyRuntimeInfo symbols become documented.
124+
- "--test_tag_filters=-integration-test,-doc_check_test"
125+
96126
debian:
97127
<<: *reusable_config
98128
name: Default test on Debian
@@ -107,7 +137,6 @@ tasks:
107137
platform: windows
108138
test_flags:
109139
- "--test_tag_filters=-integration-test,-fix-windows"
110-
111140
rbe_min:
112141
<<: *minimum_supported_version
113142
<<: *reusable_config
@@ -262,34 +291,6 @@ tasks:
262291
name: multi_python_versions integration tests on Windows
263292
working_directory: examples/multi_python_versions
264293
platform: windows
265-
266-
integration_test_pip_install_ubuntu_min:
267-
<<: *minimum_supported_version
268-
<<: *reusable_build_test_all
269-
name: pip_install integration tests on Ubuntu using minimum supported Bazel version
270-
working_directory: examples/pip_install
271-
platform: ubuntu2004
272-
integration_test_pip_install_ubuntu:
273-
<<: *reusable_build_test_all
274-
name: pip_install integration tests on Ubuntu
275-
working_directory: examples/pip_install
276-
platform: ubuntu2004
277-
integration_test_pip_install_debian:
278-
<<: *reusable_build_test_all
279-
name: pip_install integration tests on Debian
280-
working_directory: examples/pip_install
281-
platform: debian11
282-
integration_test_pip_install_macos:
283-
<<: *reusable_build_test_all
284-
name: pip_install integration tests on macOS
285-
working_directory: examples/pip_install
286-
platform: macos
287-
integration_test_pip_install_windows:
288-
<<: *reusable_build_test_all
289-
name: pip_install integration tests on Windows
290-
working_directory: examples/pip_install
291-
platform: windows
292-
293294
integration_test_pip_parse_ubuntu_min:
294295
<<: *minimum_supported_version
295296
<<: *reusable_build_test_all

‎docs/BUILD.bazel

Copy file name to clipboardExpand all lines: docs/BUILD.bazel
+19-12Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
1616
load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
1717
load("@bazel_skylib//rules:write_file.bzl", "write_file")
1818
load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")
19+
load("//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED") # buildifier: disable=bzl-visibility
1920

2021
package(default_visibility = ["//visibility:public"])
2122

@@ -74,27 +75,32 @@ bzl_library(
7475
],
7576
)
7677

78+
# Empty list means "compatible with all".
79+
# Stardoc+bzlmod doesn't currently work with our docs, so disable trying to
80+
# build it for now.
81+
_COMPATIBLE_PLATFORM = [] if not BZLMOD_ENABLED else ["@platforms//:incompatible"]
82+
7783
# TODO: Stardoc does not guarantee consistent outputs accross platforms (Unix/Windows).
7884
# As a result we do not build or test docs on Windows.
79-
_NOT_WINDOWS = select({
80-
"@platforms//os:linux": [],
81-
"@platforms//os:macos": [],
85+
_TARGET_COMPATIBLE_WITH = select({
86+
"@platforms//os:linux": _COMPATIBLE_PLATFORM,
87+
"@platforms//os:macos": _COMPATIBLE_PLATFORM,
8288
"//conditions:default": ["@platforms//:incompatible"],
8389
})
8490

8591
stardoc(
8692
name = "core-docs",
8793
out = "python.md_",
8894
input = "//python:defs.bzl",
89-
target_compatible_with = _NOT_WINDOWS,
95+
target_compatible_with = _TARGET_COMPATIBLE_WITH,
9096
deps = [":defs"],
9197
)
9298

9399
stardoc(
94100
name = "pip-docs",
95101
out = "pip.md_",
96102
input = "//python:pip.bzl",
97-
target_compatible_with = _NOT_WINDOWS,
103+
target_compatible_with = _TARGET_COMPATIBLE_WITH,
98104
deps = [
99105
":bazel_repo_tools",
100106
":pip_install_bzl",
@@ -106,7 +112,7 @@ stardoc(
106112
name = "pip-repository",
107113
out = "pip_repository.md_",
108114
input = "//python/pip_install:pip_repository.bzl",
109-
target_compatible_with = _NOT_WINDOWS,
115+
target_compatible_with = _TARGET_COMPATIBLE_WITH,
110116
deps = [
111117
":bazel_repo_tools",
112118
":pip_install_bzl",
@@ -119,7 +125,7 @@ stardoc(
119125
name = "py-console-script-binary",
120126
out = "py_console_script_binary.md_",
121127
input = "//python/entry_points:py_console_script_binary.bzl",
122-
target_compatible_with = _NOT_WINDOWS,
128+
target_compatible_with = _TARGET_COMPATIBLE_WITH,
123129
deps = [
124130
"//python/entry_points:py_console_script_binary_bzl",
125131
],
@@ -129,7 +135,7 @@ stardoc(
129135
name = "packaging-docs",
130136
out = "packaging.md_",
131137
input = "//python:packaging.bzl",
132-
target_compatible_with = _NOT_WINDOWS,
138+
target_compatible_with = _TARGET_COMPATIBLE_WITH,
133139
deps = ["//python:packaging_bzl"],
134140
)
135141

@@ -141,7 +147,7 @@ stardoc(
141147
# doesn't do anything interesting to users, so bypass it to avoid having to
142148
# copy/paste all the rule's doc in the macro.
143149
input = "//python/private:py_cc_toolchain_rule.bzl",
144-
target_compatible_with = _NOT_WINDOWS,
150+
target_compatible_with = _TARGET_COMPATIBLE_WITH,
145151
deps = ["//python/private:py_cc_toolchain_bzl"],
146152
)
147153

@@ -158,7 +164,8 @@ stardoc(
158164
failure_message = "Please run: bazel run //docs:update",
159165
file1 = k + ".md",
160166
file2 = k + ".md_",
161-
target_compatible_with = _NOT_WINDOWS,
167+
tags = ["doc_check_test"],
168+
target_compatible_with = _TARGET_COMPATIBLE_WITH,
162169
)
163170
for k in _DOCS.keys()
164171
]
@@ -173,12 +180,12 @@ write_file(
173180
"cp -fv bazel-bin/docs/{0}.md_ docs/{0}.md".format(k)
174181
for k in _DOCS.keys()
175182
],
176-
target_compatible_with = _NOT_WINDOWS,
183+
target_compatible_with = _TARGET_COMPATIBLE_WITH,
177184
)
178185

179186
sh_binary(
180187
name = "update",
181188
srcs = ["update.sh"],
182189
data = _DOCS.values(),
183-
target_compatible_with = _NOT_WINDOWS,
190+
target_compatible_with = _TARGET_COMPATIBLE_WITH,
184191
)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.