Skip to content

Commit 11f41c5

Browse files
committed
fix tests
1 parent 79288e6 commit 11f41c5

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

python/private/pypi/whl_library_targets.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def whl_library_targets(
108108
*,
109109
name,
110110
dep_template,
111+
sdist_filename = None,
111112
data_exclude = [],
112113
srcs_exclude = [],
113114
tags = [],
@@ -135,10 +136,10 @@ def whl_library_targets(
135136
Args:
136137
name: {type}`str` The file to match for including it into the `whl`
137138
filegroup. This may be also parsed to generate extra metadata.
138-
sdist_filename: {type}`str | None` If the wheel was built from an sdist,
139-
the filename of the sdist.
140139
dep_template: {type}`str` The dep_template to use for dependency
141140
interpolation.
141+
sdist_filename: {type}`str | None` If the wheel was built from an sdist,
142+
the filename of the sdist.
142143
tags: {type}`list[str]` The tags set on the `py_library`.
143144
dependencies: {type}`list[str]` A list of dependencies.
144145
dependencies_by_platform: {type}`dict[str, list[str]]` A list of

tests/pypi/pkg_aliases/pkg_aliases_test.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def _test_legacy_aliases(env):
4343
"whl": "@repo//:whl",
4444
"data": "@repo//:data",
4545
"dist_info": "@repo//:dist_info",
46+
"extracted_whl_files": "@repo//:extracted_whl_files",
4647
"my_special": "@repo//:my_special",
4748
}
4849

@@ -242,6 +243,10 @@ def _test_group_aliases(env):
242243
"name": "dist_info",
243244
"actual": "@repo//:dist_info",
244245
},
246+
{
247+
"name": "extracted_whl_files",
248+
"actual": "@repo//:extracted_whl_files",
249+
},
245250
{
246251
"name": "pkg",
247252
"actual": "//_groups:my_group_pkg",

tests/pypi/whl_library_targets/whl_library_targets_tests.bzl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ _tests = []
2727
def _test_filegroups(env):
2828
calls = []
2929

30-
def glob(match, *, allow_empty):
30+
def glob(include, *, exclude = [], allow_empty):
3131
env.expect.that_bool(allow_empty).equals(True)
32-
return match
32+
return include
3333

3434
whl_library_targets(
3535
name = "",
@@ -41,7 +41,7 @@ def _test_filegroups(env):
4141
rules = struct(),
4242
)
4343

44-
env.expect.that_collection(calls).contains_exactly([
44+
env.expect.that_collection(calls, expr = "filegroup calls").contains_exactly([
4545
{
4646
"name": "dist_info",
4747
"srcs": ["site-packages/*.dist-info/**"],
@@ -52,6 +52,11 @@ def _test_filegroups(env):
5252
"srcs": ["data/**"],
5353
"visibility": ["//visibility:public"],
5454
},
55+
{
56+
"name": "extracted_whl_files",
57+
"srcs": ["**"],
58+
"visibility": ["//visibility:public"],
59+
},
5560
{
5661
"name": "whl",
5762
"srcs": [""],

0 commit comments

Comments
 (0)