File tree Expand file tree Collapse file tree 7 files changed +23
-13
lines changed
Expand file tree Collapse file tree 7 files changed +23
-13
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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 " )
88bazel_dep (name = "bazel_skylib" , version = "1.6.1" )
99bazel_dep (name = "rules_cc" , version = "0.0.9" )
1010bazel_dep (name = "platforms" , version = "0.0.4" )
Original file line number Diff line number Diff 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 (
Original file line number Diff line number Diff 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+
182190bzl_library (
183191 name = "internal_config_repo_bzl" ,
184192 srcs = ["internal_config_repo.bzl" ],
Original file line number Diff line number Diff line change 1414
1515"Utilities for glob exclusions."
1616
17+ load ("@bazel_features//:features.bzl" , "bazel_features" )
18+
1719def _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
3230glob_excludes = struct (
3331 version_dependent_exclusions = _version_dependent_exclusions ,
Original file line number Diff line number Diff 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)
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ def _to_comment(comment):
115115def _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 ),
You can’t perform that action at this time.
0 commit comments