-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a transition rule that transitions all_requiremnts file to test b…
…uild of sdist
- Loading branch information
Showing
3 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" Define a custom transition that sets the pip_whl flag to no """ | ||
|
||
def _flag_transition_impl(_settings, _ctx): | ||
return {"@rules_python//python/config_settings:pip_whl": "no"} | ||
|
||
flag_transition = transition( | ||
implementation = _flag_transition_impl, | ||
inputs = [], | ||
outputs = ["@rules_python//python/config_settings:pip_whl"], | ||
) | ||
|
||
# Define a rule that applies the transition to dependencies | ||
def _transition_rule_impl(_ctx): | ||
return [DefaultInfo()] | ||
|
||
transition_rule = rule( | ||
implementation = _transition_rule_impl, | ||
attrs = { | ||
"deps": attr.label_list(cfg = flag_transition), | ||
"_allowlist_function_transition": attr.label( | ||
default = "@bazel_tools//tools/allowlists/function_transition_allowlist", | ||
), | ||
}, | ||
) |