Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ build:rtd --stamp
build:rtd --enable_bzlmod

common --incompatible_python_disallow_native_rules
common --incompatible_no_implicit_file_export

build --lockfile_mode=update
5 changes: 5 additions & 0 deletions python/private/pypi/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ exports_files(
visibility = ["//visibility:public"],
)

exports_files(
srcs = ["deps.bzl"],
visibility = ["//tools/private/update_deps:__pkg__"],
)

filegroup(
name = "distribution",
srcs = glob(
Expand Down
12 changes: 12 additions & 0 deletions python/private/pypi/generate_whl_library_build_bazel.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,18 @@ def generate_whl_library_build_bazel(
])

additional_content = []
entry_points = kwargs.get("entry_points")
if entry_points:
entry_point_files = sorted({
entry_point_script.replace("\\", "/"): True
for entry_point_script in entry_points.values()
}.keys())
additional_content.append(
"exports_files(\n" +
" srcs = {},\n".format(render.list(entry_point_files)) +
" visibility = [\"//visibility:public\"],\n" +
")\n",
)
if annotation:
kwargs["data"] = annotation.data
kwargs["copy_files"] = annotation.copy_files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ whl_library_targets(
tags = ["tag1"],
)

exports_files(
srcs = ["bar.py"],
visibility = ["//visibility:public"],
)

# SOMETHING SPECIAL AT THE END
"""
actual = generate_whl_library_build_bazel(
Expand Down Expand Up @@ -122,6 +127,11 @@ whl_library_targets_from_requires(
srcs_exclude = ["srcs_exclude_all"],
)

exports_files(
srcs = ["bar.py"],
visibility = ["//visibility:public"],
)

# SOMETHING SPECIAL AT THE END
"""
actual = generate_whl_library_build_bazel(
Expand Down Expand Up @@ -187,6 +197,11 @@ whl_library_targets_from_requires(
srcs_exclude = ["srcs_exclude_all"],
)

exports_files(
srcs = ["bar.py"],
visibility = ["//visibility:public"],
)

# SOMETHING SPECIAL AT THE END
"""
actual = generate_whl_library_build_bazel(
Expand Down Expand Up @@ -252,6 +267,11 @@ whl_library_targets_from_requires(
srcs_exclude = ["srcs_exclude_all"],
)

exports_files(
srcs = ["bar.py"],
visibility = ["//visibility:public"],
)

# SOMETHING SPECIAL AT THE END
"""
actual = generate_whl_library_build_bazel(
Expand Down