@@ -19,7 +19,7 @@ load("//python/private:envsubst.bzl", "envsubst")
19
19
load ("//python/private:is_standalone_interpreter.bzl" , "is_standalone_interpreter" )
20
20
load ("//python/private:repo_utils.bzl" , "REPO_DEBUG_ENV_VAR" , "repo_utils" )
21
21
load (":attrs.bzl" , "ATTRS" , "use_isolated" )
22
- load (":deps.bzl" , "all_repo_names" )
22
+ load (":deps.bzl" , "all_repo_names" , "record_files" )
23
23
load (":generate_whl_library_build_bazel.bzl" , "generate_whl_library_build_bazel" )
24
24
load (":parse_whl_name.bzl" , "parse_whl_name" )
25
25
load (":patch_whl.bzl" , "patch_whl" )
@@ -242,14 +242,15 @@ def _whl_library_impl(rctx):
242
242
else :
243
243
op_tmpl = "whl_library.ResolveRequirement({name}, {requirement})"
244
244
245
- repo_utils .execute_checked (
245
+ pypi_repo_utils .execute_checked (
246
246
rctx ,
247
247
# truncate the requirement value when logging it / reporting
248
248
# progress since it may contain several ' --hash=sha256:...
249
249
# --hash=sha256:...' substrings that fill up the console
250
250
op = op_tmpl .format (name = rctx .attr .name , requirement = rctx .attr .requirement .split (" " , 1 )[0 ]),
251
251
arguments = args ,
252
252
environment = environment ,
253
+ srcs = rctx .attr ._python_srcs ,
253
254
quiet = rctx .attr .quiet ,
254
255
timeout = rctx .attr .timeout ,
255
256
logger = logger ,
@@ -291,13 +292,14 @@ def _whl_library_impl(rctx):
291
292
)
292
293
]
293
294
294
- repo_utils .execute_checked (
295
+ pypi_repo_utils .execute_checked (
295
296
rctx ,
296
297
op = "whl_library.ExtractWheel({}, {})" .format (rctx .attr .name , whl_path ),
297
298
arguments = args + [
298
299
"--whl-file" ,
299
300
whl_path ,
300
301
] + ["--platform={}" .format (p ) for p in target_platforms ],
302
+ srcs = rctx .attr ._python_srcs ,
301
303
environment = environment ,
302
304
quiet = rctx .attr .quiet ,
303
305
timeout = rctx .attr .timeout ,
@@ -450,6 +452,16 @@ attr makes `extra_pip_args` and `download_only` ignored.""",
450
452
for repo in all_repo_names
451
453
],
452
454
),
455
+ "_python_srcs" : attr .label_list (
456
+ # Used as a default value in a rule to ensure we fetch the dependencies.
457
+ default = [
458
+ Label ("//python/private/pypi/whl_installer:platform.py" ),
459
+ Label ("//python/private/pypi/whl_installer:wheel.py" ),
460
+ Label ("//python/private/pypi/whl_installer:wheel_installer.py" ),
461
+ Label ("//python/private/pypi/whl_installer:arguments.py" ),
462
+ Label ("//python/private/pypi/whl_installer:namespace_pkgs.py" ),
463
+ ] + record_files .values (),
464
+ ),
453
465
"_rule_name" : attr .string (default = "whl_library" ),
454
466
}, ** ATTRS )
455
467
whl_library_attrs .update (AUTH_ATTRS )
0 commit comments