Skip to content

Commit 8179c41

Browse files
committed
Use updated bazel-features dep
1 parent ba1e1e2 commit 8179c41

File tree

7 files changed

+23
-13
lines changed

7 files changed

+23
-13
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ A brief description of the categories of changes:
3232
{#v0-0-0-fixed}
3333
### Fixed
3434
* (pypi) Allow spaces in filenames included in `whl_library`s
35-
([616](https://github.com/bazelbuild/rules_python/issues/617))
35+
([616](https://github.com/bazelbuild/rules_python/issues/617)
36+
* (deps) Bump bazel-features to detect whether spaces are allowed
37+
in filenames ([616](https://github.com/bazelbuild/rules_python/issues/617)
3638

3739
{#v0-0-0-added}
3840
### Added

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module(
44
compatibility_level = 1,
55
)
66

7-
bazel_dep(name = "bazel_features", version = "1.9.1")
7+
bazel_dep(name = "bazel_features", version = "1.20.0")
88
bazel_dep(name = "bazel_skylib", version = "1.6.1")
99
bazel_dep(name = "rules_cc", version = "0.0.9")
1010
bazel_dep(name = "platforms", version = "0.0.4")

internal_deps.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ def rules_python_internal_deps():
220220

221221
http_archive(
222222
name = "bazel_features",
223-
sha256 = "d7787da289a7fb497352211ad200ec9f698822a9e0757a4976fd9f713ff372b3",
224-
strip_prefix = "bazel_features-1.9.1",
225-
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.9.1/bazel_features-v1.9.1.tar.gz",
223+
sha256 = "c2596994cf63513bd44180411a4ac3ae95d32bf59148fcb6087a4642b3ffef11",
224+
strip_prefix = "bazel_features-1.20.0",
225+
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.20.0/bazel_features-v1.20.0.tar.gz",
226226
)
227227

228228
http_archive(

python/private/BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,14 @@ bzl_library(
179179
srcs = ["full_version.bzl"],
180180
)
181181

182+
bzl_library(
183+
name = "glob_excludes_bzl",
184+
srcs = ["glob_excludes.bzl"],
185+
deps = [
186+
"@bazel_features//:features",
187+
],
188+
)
189+
182190
bzl_library(
183191
name = "internal_config_repo_bzl",
184192
srcs = ["internal_config_repo.bzl"],

python/private/glob_excludes.bzl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,18 @@
1414

1515
"Utilities for glob exclusions."
1616

17+
load("@bazel_features//:features.bzl", "bazel_features")
18+
1719
def _version_dependent_exclusions():
1820
"""Returns glob exclusions that are sensitive to Bazel version.
1921
20-
Bazel 7.4.0+ added support for files with spaces. Prior versions of Bazel
21-
do not support files with spaces.
22-
2322
Returns:
2423
a list of glob exclusion patterns
2524
"""
26-
major, minor, _ = native.bazel_version.split(".")
27-
if int(major) < 7 or (int(major) == 7 and int(minor) < 4):
28-
return ["**/* *"]
29-
else:
25+
if bazel_features.rules.all_characters_allowed_in_runfiles:
3026
return []
27+
else:
28+
return ["**/* *"]
3129

3230
glob_excludes = struct(
3331
version_dependent_exclusions = _version_dependent_exclusions,

python/private/pypi/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ bzl_library(
8686
srcs = ["deps.bzl"],
8787
deps = [
8888
"//python/private:bazel_tools_bzl",
89+
"//python/private:glob_excludes_bzl",
8990
],
9091
)
9192

@@ -111,6 +112,7 @@ bzl_library(
111112
srcs = ["generate_whl_library_build_bazel.bzl"],
112113
deps = [
113114
":labels_bzl",
115+
"//python/private:glob_excludes_bzl",
114116
"//python/private:normalize_name_bzl",
115117
],
116118
)

python/private/pypi/deps.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _to_comment(comment):
115115
def _format_exclusions(exclusions, indent_depth):
116116
indent = " " * indent_depth
117117
return "\n".join([
118-
"{indent}{excl},{comment}".format(
118+
"{indent}\"{excl}\",{comment}".format(
119119
indent = indent,
120120
excl = excl,
121121
comment = _to_comment(comment),

0 commit comments

Comments
 (0)