Skip to content

Commit b7dc668

Browse files
committed
[py] copy license file to distributions
fixes #12166
1 parent 0972a1b commit b7dc668

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

py/BUILD.bazel

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@bazel_skylib//rules:select_file.bzl", "select_file")
12
load("@py_dev_requirements//:requirements.bzl", "requirement")
23
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
34
load("@rules_pkg//pkg:pkg.bzl", "pkg_tar")
@@ -115,6 +116,24 @@ copy_file(
115116
out = "test/extensions/webextensions-selenium-example-unsigned.zip",
116117
)
117118

119+
select_file(
120+
name = "global-license",
121+
srcs = "//:license",
122+
subpath = "LICENSE",
123+
)
124+
125+
copy_file(
126+
name = "license",
127+
src = ":global-license",
128+
out = "LICENSE",
129+
)
130+
131+
copy_file(
132+
name = "license-wheel",
133+
src = ":global-license",
134+
out = "selenium-%s.dist-info/LICENSE" % SE_VERSION,
135+
)
136+
118137
py_library(
119138
name = "selenium",
120139
srcs = glob(
@@ -167,6 +186,7 @@ pkg_files(
167186
"MANIFEST.in",
168187
"README.rst",
169188
"setup.py",
189+
":license",
170190
":selenium-pkg",
171191
":selenium-pkginfo",
172192
],
@@ -228,6 +248,7 @@ py_wheel(
228248
version = SE_VERSION,
229249
visibility = ["//visibility:public"],
230250
deps = [
251+
":license-wheel",
231252
":selenium-pkg",
232253
],
233254
)

0 commit comments

Comments
 (0)