Skip to content

Commit 33f7c91

Browse files
committed
remove extra bazel 6 code
1 parent da0f302 commit 33f7c91

File tree

3 files changed

+3
-27
lines changed

3 files changed

+3
-27
lines changed

python/private/py_package.bzl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,8 @@ def _py_package_impl(ctx):
4141
py_info.merge_target(dep)
4242
py_info = py_info.build()
4343
inputs.add(py_info.transitive_sources)
44-
45-
# Remove conditional once Bazel 6 support dropped.
46-
if hasattr(py_info, "transitive_pyc_files"):
47-
inputs.add(py_info.transitive_pyc_files)
48-
49-
if hasattr(py_info, "transitive_pyi_files"):
50-
inputs.add(py_info.transitive_pyi_files)
44+
inputs.add(py_info.transitive_pyc_files)
45+
inputs.add(py_info.transitive_pyi_files)
5146

5247
inputs = inputs.build()
5348

python/private/py_runtime_rule.bzl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,7 @@ The {obj}`PyRuntimeInfo.zip_main_template` field.
384384
)
385385

386386
def _is_singleton_depset(files):
387-
# Bazel 6 doesn't have this helper to optimize detecting singleton depsets.
388-
if _py_builtins:
389-
return _py_builtins.is_singleton_depset(files)
390-
else:
391-
return len(files.to_list()) == 1
387+
return _py_builtins.is_singleton_depset(files)
392388

393389
def _interpreter_version_info_from_version_str(version_str):
394390
parts = version_str.split(".")

python/private/python_register_toolchains.bzl

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,6 @@ def python_register_toolchains(
9797

9898
toolchain_repo_name = "{name}_toolchains".format(name = name)
9999

100-
# When using unreleased Bazel versions, the version is an empty string
101-
if native.bazel_version:
102-
bazel_major = int(native.bazel_version.split(".")[0])
103-
if bazel_major < 6:
104-
if register_coverage_tool:
105-
# buildifier: disable=print
106-
print((
107-
"WARNING: ignoring register_coverage_tool=True when " +
108-
"registering @{name}: Bazel 6+ required, got {version}"
109-
).format(
110-
name = name,
111-
version = native.bazel_version,
112-
))
113-
register_coverage_tool = False
114-
115100
# list[str] of the platform names that were used
116101
loaded_platforms = []
117102

0 commit comments

Comments
 (0)