File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,11 @@ END_UNRELEASED_TEMPLATE
72
72
* (pypi) ` pipstar ` flag has been flipped to be enabled by default, to turn it
73
73
off use ` RULES_PYTHON_ENABLE_PIPSTAR=0 ` environment variable. If you do, please
74
74
add a comment to
75
- [ #2949 ] ( https://github.com/bazel-contrib/rules_python/issues/2949 ) .
75
+ [ #2949 ] ( https://github.com/bazel-contrib/rules_python/issues/2949 ) . On ` WORKSPACE `
76
+ you will see ` whl_library ` re-fetching if the list of packages in the
77
+ ` requirements.txt ` file changes, to workaround this in cases where you are not
78
+ vendoring the requirements you can set
79
+ {obj}` pip_repository.use_hub_alias_dependencies ` to ` True ` .
76
80
77
81
{#v0-0-0-fixed}
78
82
### Fixed
Original file line number Diff line number Diff line change @@ -85,13 +85,15 @@ def generate_whl_library_build_bazel(
85
85
]
86
86
dep_template = kwargs .get ("dep_template" )
87
87
packages = kwargs .pop ("packages" , [])
88
- if kwargs .get ("requires_dist" ):
88
+ if not kwargs .get ("requires_dist" ):
89
+ # no deps, we can leave the extra loads out
90
+ pass
91
+ elif packages :
92
+ kwargs ["include" ] = render .list (packages )
93
+ else :
89
94
packages_load = dep_template .format (name = "" , target = "requirements.bzl" )
90
- if "_//" in packages_load :
91
- kwargs ["include" ] = render .list (packages )
92
- else :
93
- loads .append ("""load("{}", "{}")""" .format (packages_load , "packages" ))
94
- kwargs ["include" ] = "packages"
95
+ loads .append ("""load("{}", "{}")""" .format (packages_load , "packages" ))
96
+ kwargs ["include" ] = "packages"
95
97
96
98
for arg in unsupported_args :
97
99
if kwargs .get (arg ):
Original file line number Diff line number Diff line change @@ -428,7 +428,7 @@ def _whl_library_impl(rctx):
428
428
dep_template = rctx .attr .dep_template or "@{}{{name}}//:{{target}}" .format (
429
429
rctx .attr .repo_prefix ,
430
430
),
431
- packages = rctx .attr .packages ,
431
+ packages = rctx .attr .packages if rctx . attr . repo_prefix else [] ,
432
432
entry_points = entry_points ,
433
433
metadata_name = metadata .name ,
434
434
metadata_version = metadata .version ,
You can’t perform that action at this time.
0 commit comments