|
16 | 16 |
|
17 | 17 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
18 | 18 | load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") |
19 | | -load("//python/private:glob_excludes.bzl", "glob_excludes") |
20 | 19 |
|
21 | 20 | _RULE_DEPS = [ |
22 | 21 | # START: maintained by 'bazel run //tools/private/update_deps:update_pip_deps' |
@@ -98,52 +97,31 @@ _RULE_DEPS = [ |
98 | 97 | # END: maintained by 'bazel run //tools/private/update_deps:update_pip_deps' |
99 | 98 | ] |
100 | 99 |
|
101 | | -_EXCLUSIONS = [ |
102 | | - ("**/*.py", None), |
103 | | - ("**/*.pyc", None), |
104 | | - ("**/*.pyc.*", "During pyc creation, temp files named *.pyc.NNN are created"), |
105 | | - ("**/*.dist-info/RECORD", None), |
106 | | - ("BUILD", None), |
107 | | - ("WORKSPACE", None), |
108 | | -] + [(e, None) for e in glob_excludes.version_dependent_exclusions()] |
109 | | - |
110 | | -def _to_comment(comment): |
111 | | - if comment: |
112 | | - return " #" + comment |
113 | | - return "" |
114 | | - |
115 | | -def _format_exclusions(exclusions, indent_depth): |
116 | | - indent = " " * indent_depth |
117 | | - return "\n".join([ |
118 | | - "{indent}\"{excl}\",{comment}".format( |
119 | | - indent = indent, |
120 | | - excl = excl, |
121 | | - comment = _to_comment(comment), |
122 | | - ) |
123 | | - for excl, comment in exclusions |
124 | | - ]) |
125 | | - |
126 | 100 | _GENERIC_WHEEL = """\ |
127 | 101 | package(default_visibility = ["//visibility:public"]) |
128 | 102 |
|
129 | 103 | load("@rules_python//python:defs.bzl", "py_library") |
| 104 | +load("@rules_python//python:glob_excludes.bzl", "glob_excludes") |
130 | 105 |
|
131 | 106 | py_library( |
132 | 107 | name = "lib", |
133 | 108 | srcs = glob(["**/*.py"]), |
134 | | - data = glob( |
135 | | - ["**/*"], |
| 109 | + data = glob(["**/*"], exclude=[ |
136 | 110 | # These entries include those put into user-installed dependencies by |
137 | 111 | # data_exclude to avoid non-determinism. |
138 | | - exclude=[ |
139 | | -{exclusions} |
140 | | - ], |
141 | | - ), |
| 112 | + "**/*.py", |
| 113 | + "**/*.pyc", |
| 114 | + "**/*.pyc.*", # During pyc creation, temp files named *.pyc.NNN are created |
| 115 | + "**/* *", |
| 116 | + "**/*.dist-info/RECORD", |
| 117 | + "BUILD", |
| 118 | + "WORKSPACE", |
| 119 | + ] + glob_excludes.version_dependent_exclusions()), |
142 | 120 | # This makes this directory a top-level in the python import |
143 | 121 | # search path for anything that depends on this. |
144 | 122 | imports = ["."], |
145 | 123 | ) |
146 | | -""".format(exclusions = _format_exclusions(_EXCLUSIONS, 12)) |
| 124 | +""" |
147 | 125 |
|
148 | 126 | # Collate all the repository names so they can be easily consumed |
149 | 127 | all_repo_names = [name for (name, _, _) in _RULE_DEPS] |
|
0 commit comments