Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 python/private/pypi/labels.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

"""Constants used by parts of pip_repository for naming libraries and wheels."""

EXTRACTED_WHEEL_FILES = "extracted_whl_files"
WHEEL_FILE_PUBLIC_LABEL = "whl"
WHEEL_FILE_IMPL_LABEL = "_whl"
PY_LIBRARY_PUBLIC_LABEL = "pkg"
Expand Down
18 changes: 14 additions & 4 deletions python/private/pypi/whl_library_targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ load(
":labels.bzl",
"DATA_LABEL",
"DIST_INFO_LABEL",
"EXTRACTED_WHEEL_FILES",
"PY_LIBRARY_IMPL_LABEL",
"PY_LIBRARY_PUBLIC_LABEL",
"WHEEL_ENTRY_POINT_PREFIX",
Expand Down Expand Up @@ -101,8 +102,16 @@ def whl_library_targets(
srcs_exclude = [],
tags = [],
filegroups = {
DIST_INFO_LABEL: ["site-packages/*.dist-info/**"],
DATA_LABEL: ["data/**"],
EXTRACTED_WHEEL_FILES: dict(
include = ["**"],
exclude = ["*.whl"],
),
DIST_INFO_LABEL: dict(
include = ["site-packages/*.dist-info/**"],
),
DATA_LABEL: dict(
include = ["data/**"],
),
},
dependencies = [],
dependencies_by_platform = {},
Expand Down Expand Up @@ -168,10 +177,11 @@ def whl_library_targets(
tags = sorted(tags)
data = [] + data

for filegroup_name, glob in filegroups.items():
for filegroup_name, glob_kwargs in filegroups.items():
glob_kwargs = {"allow_empty": True} | glob_kwargs
native.filegroup(
name = filegroup_name,
srcs = native.glob(glob, allow_empty = True),
srcs = native.glob(**glob_kwargs),
visibility = ["//visibility:public"],
)

Expand Down